-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong error message for binary_to_existing_atom/2 #4900
Comments
bjorng
added a commit
to bjorng/otp
that referenced
this issue
May 27, 2021
The extended error information binary_to_existing_atom/2 when the encoding was `utf8` or `unicode`: 1> binary_to_existing_atom(<<"oops doesnt_really_exist">>, utf8). ** exception error: bad argument in function binary_to_existing_atom/2 called as binary_to_existing_atom(<<"oops doesnt_really_exist">>,utf8) *** argument 1: invalid UTF8 encoding Corrected: 1> binary_to_existing_atom(<<"oops doesnt_really_exist">>, utf8). ** exception error: bad argument in function binary_to_existing_atom/2 called as binary_to_existing_atom(<<"oops doesnt_really_exist">>,utf8) *** argument 1: not an already existing atom Closes erlang#4900.
bjorng
added a commit
to bjorng/otp
that referenced
this issue
May 27, 2021
The extended error information for binary_to_existing_atom/2 was wrong when the encoding was `utf8` or `unicode`: 1> binary_to_existing_atom(<<"oops doesnt_really_exist">>, utf8). ** exception error: bad argument in function binary_to_existing_atom/2 called as binary_to_existing_atom(<<"oops doesnt_really_exist">>,utf8) *** argument 1: invalid UTF8 encoding Corrected: 1> binary_to_existing_atom(<<"oops doesnt_really_exist">>, utf8). ** exception error: bad argument in function binary_to_existing_atom/2 called as binary_to_existing_atom(<<"oops doesnt_really_exist">>,utf8) *** argument 1: not an already existing atom Closes erlang#4900.
bjorng
added a commit
to bjorng/otp
that referenced
this issue
May 27, 2021
The extended error information for `binary_to_existing_atom/2` was wrong when the encoding was `utf8` or `unicode`: 1> binary_to_existing_atom(<<"oops doesnt_really_exist">>, utf8). ** exception error: bad argument in function binary_to_existing_atom/2 called as binary_to_existing_atom(<<"oops doesnt_really_exist">>,utf8) *** argument 1: invalid UTF8 encoding Corrected: 1> binary_to_existing_atom(<<"oops doesnt_really_exist">>, utf8). ** exception error: bad argument in function binary_to_existing_atom/2 called as binary_to_existing_atom(<<"oops doesnt_really_exist">>,utf8) *** argument 1: not an already existing atom Closes erlang#4900.
bjorng
added a commit
to bjorng/otp
that referenced
this issue
May 27, 2021
The extended error information for `binary_to_existing_atom/2` was wrong when the encoding was `utf8` or `unicode`: 1> binary_to_existing_atom(<<"oops doesnt_really_exist">>, utf8). ** exception error: bad argument in function binary_to_existing_atom/2 called as binary_to_existing_atom(<<"oops doesnt_really_exist">>,utf8) *** argument 1: invalid UTF8 encoding Corrected: 1> binary_to_existing_atom(<<"oops doesnt_really_exist">>, utf8). ** exception error: bad argument in function binary_to_existing_atom/2 called as binary_to_existing_atom(<<"oops doesnt_really_exist">>,utf8) *** argument 1: not an already existing atom Also fix a similar problem for list_to_existing_atom/1. Closes erlang#4900.
bjorng
added a commit
that referenced
this issue
May 28, 2021
…-17449 Correct error message for binary_to_existing_atom/2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
If you give an ASCII binary to
binary_to_existing_atom/1
andbinary_to_existing_atom/2
, which is not an existing atom, it raises as expected, but the error message says it says the error is caused by the utf8 encoding, which is wrong.To Reproduce
Expected behavior
Probably to show the same error message as list_to_existing_atom/1:
However, note that giving a non-list argument to
list_to_existing_atom/1
shows a wrong error message too:It should say it is not a list instead.
Affected versions
OTP 24.
The text was updated successfully, but these errors were encountered: