Skip to content
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

document arguments to exception constructors #7766

Closed
sjkelly opened this issue Jul 29, 2014 · 4 comments
Closed

document arguments to exception constructors #7766

sjkelly opened this issue Jul 29, 2014 · 4 comments
Labels
docs This change adds or pertains to documentation

Comments

@sjkelly
Copy link
Contributor

sjkelly commented Jul 29, 2014

in : http://docs.julialang.org/en/latest/manual/control-flow/#built-in-exceptions

julia> ArgumentError()
ERROR: `ArgumentError` has no method matching ArgumentError()

julia> BoundsError()
BoundsError()

julia> DivideError()
DivideError()

julia> DomainError()
DomainError()

julia> EOFError()
EOFError()

julia> ErrorException()
ERROR: `ErrorException` has no method matching ErrorException()

julia> InexactError()
InexactError()

julia> InterruptException()
InterruptException()

julia> KeyError()
ERROR: `KeyError` has no method matching KeyError()

julia> LoadError()
ERROR: `LoadError` has no method matching LoadError()

julia> MemoryError()
MemoryError()

julia> MethodError()
ERROR: `MethodError` has no method matching MethodError()

julia> OverflowError()
OverflowError()

julia> ParseError()
ERROR: `ParseError` has no method matching ParseError()

julia> SystemError()
ERROR: `SystemError` has no method matching SystemError()

julia> TypeError()
ERROR: `TypeError` has no method matching TypeError()

julia> UndefRefError()
UndefRefError()

It looks like these are all being exported in https://github.com/JuliaLang/julia/blob/c7fb8f5be03edd30598ef49f10d175601690f997/base/exports.jl

Am I doing something wrong?

@quinnj
Copy link
Member

quinnj commented Jul 29, 2014

The no method errors are because some of them take string arguments as the error message to be shown to the user.

@sjkelly
Copy link
Contributor Author

sjkelly commented Jul 29, 2014

@quinnj That makes sense. I could either update the docs indicating which ones take strings, or add uninitialized constructors. The former sounds better to me. What do you think?

@quinnj
Copy link
Member

quinnj commented Jul 29, 2014

Adding docs for how things are currently is always a 'yes' 😄 My guess is these methods weren't given a no-arg constructor on purpose; to make sure an explanation goes along with the exception. See also #4744 and a bunch of other threads linked to from there.

@JeffBezanson
Copy link
Member

There are help entries for those exception types, but they're documented as variables instead of functions, so their arguments are not documented. This should be fixed in doc/stdlib/base.rst.

@JeffBezanson JeffBezanson changed the title Built-in Exceptions in Docs document arguments to exception constructors Jul 29, 2014
sjkelly added a commit to sjkelly/julia that referenced this issue Apr 27, 2015
sjkelly added a commit to sjkelly/julia that referenced this issue Apr 30, 2015
@tkelman tkelman closed this as completed in 903a725 May 1, 2015
mbauman pushed a commit to mbauman/julia that referenced this issue Jun 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

No branches or pull requests

3 participants