Skip to content

Commit

Permalink
improve error message for unescape_string
Browse files Browse the repository at this point in the history
  • Loading branch information
pfitzseb committed Apr 2, 2017
1 parent ceb0674 commit f91182a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/strings/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ function unescape_string(io, s::AbstractString)
i = j
end
if k == 1
throw(ArgumentError("\\x used with no following hex digits in $(repr(s))"))
throw(ArgumentError("invalid $(m == 2 ? "hex (\\x)" :
"unicode (\\u)") escape sequence used in $(repr(s))"))
end
if m == 2 # \x escape sequence
write(io, UInt8(n))
Expand Down

0 comments on commit f91182a

Please sign in to comment.