Skip to content

Commit

Permalink
More helpful error messages for calling log/sqrt with negative real a…
Browse files Browse the repository at this point in the history
…rguments (#48347)

* More helpful error messages for log/sqrt with negative real arguments
  • Loading branch information
sloede authored Feb 8, 2023
1 parent 9639c42 commit 6fb546e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/remotecall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ julia> remotecall_fetch(sqrt, 2, 4)
julia> remotecall_fetch(sqrt, 2, -4)
ERROR: On worker 2:
DomainError with -4.0:
sqrt will only return a complex result if called with a complex argument. Try sqrt(Complex(x)).
sqrt was called with a negative real argument but will only return a complex result if called with a complex argument. Try sqrt(Complex(x)).
...
```
"""
Expand Down
2 changes: 1 addition & 1 deletion test/distributed_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ let thrown = false
thrown = true
local b = IOBuffer()
showerror(b, e)
@test occursin("sqrt will only return", String(take!(b)))
@test occursin("sqrt was called with a negative real argument", String(take!(b)))
end
@test thrown
end
Expand Down

0 comments on commit 6fb546e

Please sign in to comment.