Skip to content

Commit

Permalink
Forward the caught exception when instantiation failed.
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera committed Jun 3, 2017
1 parent c7b552c commit 2081887
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ShortcodeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,11 @@ protected function instantiate( $interface, $class, array $args ) {
$class = $this->instantiateClass( $class, $args );
}
} catch ( Exception $exception ) {
throw FailedToInstantiateObject::fromFactory( $class, $interface );
throw FailedToInstantiateObject::fromFactory(
$class,
$interface,
$exception
);
}

if ( ! is_subclass_of( $class, $interface ) ) {
Expand Down

0 comments on commit 2081887

Please sign in to comment.