Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 58 additions & 1 deletion base/base.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

"""
SystemError(prefix::AbstractString, [errno::Int32])

A system call failed with an error code (in the `errno` global variable).
"""
type SystemError <: Exception
prefix::AbstractString
errnum::Int32
Expand All @@ -9,10 +14,22 @@ type SystemError <: Exception
SystemError(p::AbstractString) = new(p, Libc.errno())
end

"""
ParseError(msg)

The expression passed to the `parse` function could not be interpreted as a valid Julia
expression.
"""
type ParseError <: Exception
msg::AbstractString
end

"""
ArgumentError(msg)

The parameters to a function call do not match a valid signature. Argument `msg` is a
descriptive error string.
"""
type ArgumentError <: Exception
msg::AbstractString
end
Expand All @@ -21,25 +38,53 @@ end
# var::Symbol
#end

"""
KeyError(key)

An indexing operation into an `Associative` (`Dict`) or `Set` like object tried to access or
delete a non-existent element.
"""
type KeyError <: Exception
key
end

"""
MethodError(f, args)

A method with the required type signature does not exist in the given generic function.
Alternatively, there is no unique most-specific method.
"""
type MethodError <: Exception
f
args
end

"""
EOFError()

No more data was available to read from a file or stream.
"""
type EOFError <: Exception end

"""
DimensionMismatch([msg])

The objects called do not have matching dimensionality. Optional argument `msg` is a
descriptive error string.
"""
type DimensionMismatch <: Exception
msg::AbstractString
end
DimensionMismatch() = DimensionMismatch("")

"""
AssertionError([msg])

The asserted condition did not evaluate to `true`.
Optional argument `msg` is a descriptive error string.
"""
type AssertionError <: Exception
msg::AbstractString

AssertionError() = new("")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the definition order probably won't affect anything, but best to avoid unrelated changes if possible. Other than that the PR looks go to me, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reordered!

AssertionError(msg) = new(msg)
end
Expand All @@ -48,12 +93,24 @@ end
#Subtypes should put the exception in an 'error' field
abstract WrappedException <: Exception

"""
LoadError(file::AbstractString, line::Int, error)

An error occurred while `include`ing, `require`ing, or `using` a file. The error specifics
should be available in the `.error` field.
"""
type LoadError <: WrappedException
file::AbstractString
line::Int
error
end

"""
InitError(mod::Symbol, error)

An error occurred when running a module's `__init__` function. The actual error thrown is
available in the `.error` field.
"""
type InitError <: WrappedException
mod::Symbol
error
Expand Down
75 changes: 0 additions & 75 deletions base/docs/helpdb/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2175,13 +2175,6 @@ Remove each element of `iterable` from set `s` in-place.
"""
setdiff!

"""
EOFError()

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

"""
isascii(c::Union{Char,AbstractString}) -> Bool

Expand Down Expand Up @@ -3016,12 +3009,6 @@ handle properly.
"""
OutOfMemoryError

"""
SystemError(prefix::AbstractString, [errno::Int32])

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

"""
binomial(n,k)
Expand Down Expand Up @@ -3060,14 +3047,6 @@ detailed system information is shown as well.
"""
versioninfo

"""
DimensionMismatch([msg])

The objects called do not have matching dimensionality. Optional argument `msg` is a
descriptive error string.
"""
DimensionMismatch

"""
sort!(v, [alg=<algorithm>,] [by=<transform>,] [lt=<comparison>,] [rev=false])

Expand Down Expand Up @@ -3653,13 +3632,6 @@ cannot be used with empty collections (see `reduce(op, itr)`).
"""
foldr(op, itr)

"""
ParseError(msg)

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

"""
delete!(collection, key)

Expand Down Expand Up @@ -4566,22 +4538,6 @@ Get the file name part of a path.
"""
basename

"""
ArgumentError(msg)

The parameters to a function call do not match a valid signature. Argument `msg` is a
descriptive error string.
"""
ArgumentError

"""
KeyError(key)

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

"""
isdiag(A) -> Bool

Expand Down Expand Up @@ -5455,13 +5411,6 @@ the array length. If the array length is excessive, the excess portion is filled
"""
digits!

"""
MethodError(f, args)

A method with the required type signature does not exist in the given generic function. Alternatively, there is no unique most-specific method.
"""
MethodError

"""
cat(dims, A...)

Expand Down Expand Up @@ -6870,22 +6819,6 @@ Compute the phase angle in radians of a complex number `z`.
"""
angle

"""
LoadError(file::AbstractString, line::Int, error)

An error occurred while `include`ing, `require`ing, or `using` a file. The error specifics
should be available in the `.error` field.
"""
LoadError

"""
InitError(mod::Symbol, error)

An error occurred when running a module's `__init__` function. The actual error thrown is
available in the `.error` field.
"""
InitError

"""
copy!(dest, src)

Expand Down Expand Up @@ -7834,14 +7767,6 @@ Integer division was attempted with a denominator value of 0.
"""
DivideError

"""
AssertionError([msg])

The asserted condition did not evaluate to `true`.
Optional argument `msg` is a descriptive error string.
"""
AssertionError

"""
Ac_ldiv_Bc(A, B)

Expand Down