You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that this pattern fails with Exception: wrong type of 1'th argument: wrong type: need string, got exception:
try {
/usr/bin/false
} except e {
fail e
}
It seems to me it should be possible to re-throw an exception. Yes, you can do fail (to-string $e) but that will lose information if and when exception objects have attributes other than cause. It also violates the DRY principal (don't repeat yourself).
On a closely related note we'll probably want fail to accept options to set the hypothetical attributes that seem likely to be added in the future. As a stepping stone fail it might be useful to augment it accept an optional cause option that can be used instead of the current string argument. Either that or the current mandatory argument could be used but not both at the same time.
The text was updated successfully, but these errors were encountered:
I noticed that this pattern fails with
Exception: wrong type of 1'th argument: wrong type: need string, got exception
:It seems to me it should be possible to re-throw an exception. Yes, you can do
fail (to-string $e)
but that will lose information if and when exception objects have attributes other thancause
. It also violates the DRY principal (don't repeat yourself).On a closely related note we'll probably want
fail
to accept options to set the hypothetical attributes that seem likely to be added in the future. As a stepping stonefail
it might be useful to augment it accept an optionalcause
option that can be used instead of the current string argument. Either that or the current mandatory argument could be used but not both at the same time.The text was updated successfully, but these errors were encountered: