Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

improve promise exception #14

Closed
wants to merge 1 commit into from
Closed

improve promise exception #14

wants to merge 1 commit into from

Conversation

dbu
Copy link
Contributor

@dbu dbu commented Dec 11, 2015

if the exception stays, we really should keep the nested exception or this will be very annoying to debug.

@sagikazarmark
Copy link
Member

👍

1 similar comment
@joelwurtz
Copy link
Member

👍

@@ -63,7 +63,7 @@ public function __construct(PromiseInterface $promise, RequestInterface $request
}

if (!($reason instanceof GuzzleExceptions\GuzzleException)) {
throw new \RuntimeException("Invalid reason");
throw new \RuntimeException("Invalid exception returned from Guzzle6", $reason);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not throw new \RuntimeException("Invalid exception returned from Guzzle6", 0, $reason); ?

And what if the reason is not an exception at all (like a string or other thing) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ups, good point. i will add a type check there. if its not an exception, i will keep ignoring it, we don't consider returning a string as reason a good idea.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think it is a UnexpectedValue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sagikazarmark sagikazarmark deleted the promise-exception branch December 15, 2015 16:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants