Skip to content

Commit 6fb546e

Browse files
authored
More helpful error messages for calling log/sqrt with negative real arguments (JuliaLang/julia#48347)
* More helpful error messages for log/sqrt with negative real arguments
1 parent 9639c42 commit 6fb546e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/remotecall.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ julia> remotecall_fetch(sqrt, 2, 4)
485485
julia> remotecall_fetch(sqrt, 2, -4)
486486
ERROR: On worker 2:
487487
DomainError with -4.0:
488-
sqrt will only return a complex result if called with a complex argument. Try sqrt(Complex(x)).
488+
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)).
489489
...
490490
```
491491
"""

test/distributed_exec.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ let thrown = false
14531453
thrown = true
14541454
local b = IOBuffer()
14551455
showerror(b, e)
1456-
@test occursin("sqrt will only return", String(take!(b)))
1456+
@test occursin("sqrt was called with a negative real argument", String(take!(b)))
14571457
end
14581458
@test thrown
14591459
end

0 commit comments

Comments
 (0)