summaryrefslogtreecommitdiff
path: root/symbol.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-25 06:56:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-25 06:56:26 +0000
commitdfca38eaa2e9b134075742cc59e9e3a21c5f0c39 (patch)
tree3086d8a2bb98bcefc41d7fec9e88e6e68abe1c0d /symbol.c
parent390f087d871446b130ae3666620ccabb2e4e2ff8 (diff)
symbol.c: more informative error message
* symbol.c (sym_check_asciionly): more informative error message with the encoding name and the inspected content. [ruby-core:73398] [Feature #12016] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/symbol.c b/symbol.c
index 8e3e0c3c55..b37be2f65b 100644
--- a/symbol.c
+++ b/symbol.c
@@ -430,7 +430,8 @@ sym_check_asciionly(VALUE str)
if (!rb_enc_asciicompat(rb_enc_get(str))) return FALSE;
switch (rb_enc_str_coderange(str)) {
case ENC_CODERANGE_BROKEN:
- rb_raise(rb_eEncodingError, "invalid encoding symbol");
+ rb_raise(rb_eEncodingError, "invalid symbol in encoding %s :%+"PRIsVALUE,
+ rb_enc_name(rb_enc_get(str)), str);
case ENC_CODERANGE_7BIT:
return TRUE;
}