Skip to content

Commit

Permalink
fix: rethrow our exceptions in writeTargetProperty, fix confusing e…
Browse files Browse the repository at this point in the history
…rror message (#247)
  • Loading branch information
priyadi authored Oct 25, 2024
1 parent c199b85 commit 5a9f076
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 1.13.3

* fix: rethrow our exceptions in `writeTargetProperty`, fix confusing error
message

## 1.13.2

* feat: `Map` now accepts false, for the more expressive `#[Map(false)]`
Expand Down
3 changes: 3 additions & 0 deletions src/Transformer/Processor/ObjectProcessor/ObjectProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Rekalogika\Mapper\Context\Context;
use Rekalogika\Mapper\Context\ExtraTargetValues;
use Rekalogika\Mapper\Context\MapperOptions;
use Rekalogika\Mapper\Exception\ExceptionInterface;
use Rekalogika\Mapper\Exception\UnexpectedValueException;
use Rekalogika\Mapper\MainTransformer\MainTransformerInterface;
use Rekalogika\Mapper\ObjectCache\ObjectCache;
Expand Down Expand Up @@ -1054,6 +1055,8 @@ public function writeTargetProperty(
}
} catch (\BadMethodCallException) {
return $target;
} catch (ExceptionInterface $e) {
throw $e;
} catch (\Throwable $e) {
throw new UnableToWriteException(
target: $target,
Expand Down

0 comments on commit 5a9f076

Please sign in to comment.