Commit 05aa6a76 authored by Éric Thiébaut's avatar Éric Thiébaut
Browse files

Provide dimension_mismatch and argument_error

parent e7aa5643
......@@ -289,3 +289,29 @@ function LinearAlgebra.lmul!(::Type{<:MayOptimize.Standard},
lmul!(A, b)
return b
end
#------------------------------------------------------------------------------
# ERRORS
"""
Tao.dimension_mismatch(args...)
throws a `DimensionMismatch` exception with `args...` converted into a string.
If no arguments are specified, the message is:
"arguments have incompatible dimensions"
"""
@noinline dimension_mismatch(mesg::String) = throw(DimensionMismatch(mesg))
@noinline dimension_mismatch(args...) = dimension_mismatch(string(arsg...))
@noinline dimension_mismatch() =
dimension_mismatch("arguments have incompatible dimensions")
"""
Tao.argument_error(args...)
throws an `ArgumentError` exception with `args...` converted into a string.
"""
@noinline argument_error(mesg::String) = throw(ArgumentError(mesg))
@noinline argument_error(args...) = argument_error(string(arsg...))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment