Change doc comment to throw ResultException
cundd opened this issue · 4 comments
unwrap() appears to throw a ResultException on error, but the doc comment mentions \Exception (see https://github.com/prewk/result/blob/master/src/Result.php#L164).
Is it possible to change the doc comment?
In the IDE PhpStorm this would be handy to add ResultException to the list of "Unchecked Exceptions".
Btw: Great library. We now only need the ?-operator 😄
I thought so too, while improve phpdocs.
But Err class support pass in constructor exception and throw this in unwrap stop me from it.
See:
Line 224 in 70add2d
Ah, yeah. Of course. That makes sense.
Thank you for the answer.
Ah, yeah I think my reasoning was that "it throws something that is or extends \Exception". By default it's ResultException but I've almost always used it with custom exceptions to make things grouped nicely at Sentry etc.