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
{{ message }}
This repository has been archived by the owner on May 5, 2020. It is now read-only.
Then in the throw() section, it explains how to create a custom error using a Symbol -- but it doesn't show how to throw this (and it isn't obvious to me and I tried unsuccessfully in the REPL).
Also, it should give an example showing how to create (and throw!) an exception that takes a string (or give the reason why this isn't good practice -- although a string-accepting exception is shown in the sidebar).
There should also be a comment on how custom exceptions should be named: the first example is for MyCustomException, but I'm guessing that the naming convention is now the same as Python's and maybe that example should be MyCustomError? Whatever the case is, it should be explained. (And if both -Exception and -Error are legitimate, again explain why and when to use which.)
The text was updated successfully, but these errors were encountered:
julia>throw(UndefVarError(:x))
ERROR: UndefVarError: x not defined
how to create (and throw!) an exception that takes a string
And it does too,
throw(DimensionMismatch("A has first dimension...")).
We are showing the use of throw here with some basic example of the syntax. Since exceptions are nothing different from normal objects and custom ones are no different from builtin once, we don't need to repeat all that here though a link could be good. A link to style guideline (and possibly expand it for exception naming) can also be good.
In http://docs.julialang.org/en/latest/manual/control-flow.html
the section just before the one explaining throw() shows how to create a custom exception with no arguments, which is fine.
Then in the throw() section, it explains how to create a custom error using a Symbol -- but it doesn't show how to throw this (and it isn't obvious to me and I tried unsuccessfully in the REPL).
Also, it should give an example showing how to create (and throw!) an exception that takes a string (or give the reason why this isn't good practice -- although a string-accepting exception is shown in the sidebar).
There should also be a comment on how custom exceptions should be named: the first example is for MyCustomException, but I'm guessing that the naming convention is now the same as Python's and maybe that example should be MyCustomError? Whatever the case is, it should be explained. (And if both -Exception and -Error are legitimate, again explain why and when to use which.)
The text was updated successfully, but these errors were encountered: