Skip to content

Commit

Permalink
update Exception list, and document arguments to exception constructo…
Browse files Browse the repository at this point in the history
…rs. [ci skip]

Closes #7766. Also update helpdb.jl.
  • Loading branch information
sjkelly committed Apr 27, 2015
1 parent 16321c7 commit cca1c26
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 31 deletions.
101 changes: 85 additions & 16 deletions doc/helpdb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2388,7 +2388,7 @@ Any[

("Base","error","error(message::AbstractString)
Raise an error with the given message
Raise an \"ErrorException\" with the given message
"),

Expand Down Expand Up @@ -2433,88 +2433,157 @@ Any[
"),

("Base","AssertionError","AssertionError
("Base","ArgumentError","ArgumentError(msg)
The parameters to a function call do not match a valid signature.
"),

("Base","AssertionError","AssertionError([msg])
The asserted condition did not evalutate to \"true\".
"),

("Base","ArgumentError","ArgumentError
("Base","BoundsError","BoundsError([a][, i])
An indexing operation into an array, \"a\", tried to access an out-
of-bounds element, \"i\".
"),

("Base","DimensionMismatch","DimensionMismatch([msg])
The objects called do not have matching dimensionality.
"),

("Base","DivideError","DivideError()
The parameters given to a function call are not valid.
Integer division was attempted with a denominator value of 0.
"),

("Base","BoundsError","BoundsError
("Base","DomainError","DomainError()
An indexing operation into an array tried to access an out-of-
bounds element.
The arguments to a function or constructor are outside the valid
domain.
"),

("Base","EOFError","EOFError
("Base","EOFError","EOFError()
No more data was available to read from a file or stream.
"),

("Base","ErrorException","ErrorException
("Base","ErrorException","ErrorException(msg)
Generic error type. The error message, in the *.msg* field, may
provide more specific details.
"),

("Base","KeyError","KeyError
("Base","InexactError","InexactError()
Type conversion cannot be done exactly.
"),

("Base","InterruptException","InterruptException()
The process was stopped by a terminal interrupt (CTRL+C).
"),

("Base","KeyError","KeyError(key)
An indexing operation into an \"Associative\" (\"Dict\") or \"Set\"
like object tried to access or delete a non-existent element.
"),

("Base","LoadError","LoadError
("Base","LoadError","LoadError(file::AbstractString, line::Int, error)
An error occurred while *including*, *requiring*, or *using* a
file. The error specifics should be available in the *.error*
field.
"),

("Base","MethodError","MethodError
("Base","MethodError","MethodError(f, args)
A method with the required type signature does not exist in the
given generic function.
"),

("Base","ParseError","ParseError
("Base","NullException","NullException()
An attempted access to a \"Nullable\" with no defined value.
"),

("Base","OutOfMemoryError","OutOfMemoryError()
A generated syntax tree was too large for the available memory.
"),

("Base","OverflowError","OverflowError()
The result of an expression is too large for the specified type and
will cause an wraparound.
"),

("Base","ParseError","ParseError(msg)
The expression passed to the *parse* function could not be
interpreted as a valid Julia expression.
"),

("Base","ProcessExitedException","ProcessExitedException
("Base","ProcessExitedException","ProcessExitedException()
After a client Julia process has exited, further attempts to
reference the dead child will throw this exception.
"),

("Base","SystemError","SystemError
("Base","StackOverflowError","StackOverflowError()
The function call grew beyond the size of the call stack. This
usually happens when a call recurses infinitely.
"),

("Base","SystemError","SystemError(prefix::AbstractString[, errnum::Int32])
A system call failed with an error code (in the \"errno\" global
variable).
"),

("Base","TypeError","TypeError
("Base","TypeError","TypeError(func::Symbol, context::AbstractString, expected::Type, got)
A type assertion failure, or calling an intrinsic function with an
incorrect argument type.
"),

("Base","UndefRefError","UndefRefError()
The item or field is not defined for the given object.
"),

("Base","UndefVarError","UndefVarError(var::Symbol)
A symbol in the current scope is not defined.
"),

("Base","Timer","Timer(f::Function)
Create a timer to call the given callback function. The callback is
Expand Down
73 changes: 58 additions & 15 deletions doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ Errors

.. function:: error(message::AbstractString)

Raise an error with the given message
Raise an ``ErrorException`` with the given message

.. function:: throw(e)

Expand Down Expand Up @@ -833,54 +833,97 @@ Errors

Throw an ``AssertionError`` if ``cond`` is false. Preferred syntax for writing assertions.

.. data:: AssertionError
.. function:: ArgumentError(msg)

The parameters to a function call do not match a valid signature.

.. function:: AssertionError([msg])

The asserted condition did not evalutate to ``true``.

.. data:: ArgumentError
.. function:: BoundsError([a],[i])

An indexing operation into an array, ``a``, tried to access an out-of-bounds element, ``i``.

.. function:: DimensionMismatch([msg])

The objects called do not have matching dimensionality.

.. function:: DivideError()

The parameters given to a function call are not valid.
Integer division was attempted with a denominator value of 0.

.. data:: BoundsError
.. function:: DomainError()

An indexing operation into an array tried to access an out-of-bounds element.
The arguments to a function or constructor are outside the valid domain.

.. data:: EOFError
.. function:: EOFError()

No more data was available to read from a file or stream.

.. data:: ErrorException
.. function:: ErrorException(msg)

Generic error type. The error message, in the `.msg` field, may provide more specific details.

.. data:: KeyError
.. function:: InexactError()

Type conversion cannot be done exactly.

.. function:: InterruptException()

The process was stopped by a terminal interrupt (CTRL+C).

.. function:: KeyError(key)

An indexing operation into an ``Associative`` (``Dict``) or ``Set`` like object tried to access or delete a non-existent element.

.. data:: LoadError
.. function:: LoadError(file::AbstractString, line::Int, error)

An error occurred while `including`, `requiring`, or `using` a file. The error specifics should be available in the `.error` field.

.. data:: MethodError
.. function:: MethodError(f, args)

A method with the required type signature does not exist in the given generic function.

.. data:: ParseError
.. function:: NullException()

An attempted access to a ``Nullable`` with no defined value.

.. function:: OutOfMemoryError()

An operation allocated too much memory for either the system or the garbage collector to handle properly.

.. function:: OverflowError()

The result of an expression is too large for the specified type and will cause an wraparound.

.. function:: ParseError(msg)

The expression passed to the `parse` function could not be interpreted as a valid Julia expression.

.. data:: ProcessExitedException
.. function:: ProcessExitedException()

After a client Julia process has exited, further attempts to reference the dead child will throw this exception.

.. data:: SystemError
.. function:: StackOverflowError()

The function call grew beyond the size of the call stack. This usually happens when a call recurses infinitely.

.. function:: SystemError(prefix::AbstractString, [errnum::Int32])

A system call failed with an error code (in the ``errno`` global variable).

.. data:: TypeError
.. function:: TypeError(func::Symbol, context::AbstractString, expected::Type, got)

A type assertion failure, or calling an intrinsic function with an incorrect argument type.

.. function:: UndefRefError()

The item or field is not defined for the given object.

.. function:: UndefVarError(var::Symbol)

A symbol in the current scope is not defined.

Events
------
Expand Down

0 comments on commit cca1c26

Please sign in to comment.