-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have register throw an error if things didn't work out #41
Comments
If the metadata field has a key |
But why not just throw an error? That seems the standard way in Julia to signal that something didn't work out as planned? |
When it's possible I prefer not to have to handle control flow with try-catch. It's not really exceptional to get a registration error. |
I wouldn't mind something like https://github.com/iamed2/ResultTypes.jl if you don't want to use try catch for this, but the current approach where it is super, super, super easy to just ignore the error strikes me as extremely brittle. It is also very non standard, so it took me for example a long time to figure out what was going on in my code. I think the core question here is whether we think that a client who calls I actually don't think try catch would be bad here. They are the standard way to do this in Julia, so folks are familiar, they quickly point users to where things go wrong via strack traces etc. |
I think packages that are really part of the community should not follow individual contributors idiosyncratic preferences. try catch is well established in Julia.
register()
do_something_else_that_assumes_register_worked() and then end up with some error deep down inside |
Would it make sense that
register
throws an error if things didn't work? The content of the.metadata
field could just be part of a custom error message?Right now it is not clear to me what exactly I should check after a call to
register
to make sure everything worked as intended.The text was updated successfully, but these errors were encountered: