Conversation
| */ | ||
| class NotFoundException extends \Exception implements OmnipayException | ||
| { | ||
| public function __construct($message = "Resource not found on payment gateway", $code = 404, $previous = null) |
There was a problem hiding this comment.
I think the code can be just 0
There was a problem hiding this comment.
Do you want me to change or 404 is also OK?
|
What do you think about the name. SHould it be more descriptive? @judgej thoughts? |
|
Can be, it is just a bit longer. Let me know please if I have to change or not. My project is waiting for these updates :) |
|
Are any of the other exceptions thrown as a result of a specific gateway request error, or does this one stand alone (possibly one of a group of related exceptions)? Just wondering (if I understand correctly) whether exceptions from the remote gateway complaining should be namespaced together, with a generic exception and more detailed exceptions extended by the drivers? |
|
The original integration was throwing only SDK’s exceptions, currently I have PR overriding only “customer not found” error, to be able to catch and recreate profile instead of showing error to user. In future we can try to morph all errors to Omnipay’s exceptions |
|
It can throw an InvalidResponse but that's not really specific. |
|
What's throwing it - Assuming it's the driver, the driver could extend Anyway - just a thought - I'm no expert at structuring exceptions, and a little behind at what PHP 7.2+ is bringing to the exception table. |
|
@judgej Totally agreed with you, I just suggested to throw this generic Omnipay's exception, to not hardcode Gateway-specific namespaces in multi-gateway application to be able to catch them all |
|
Changed to ResourceNotFoundException |
Thrown when the requested resource is not found on payment gateway to differentiate from other invalid responses