mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Debug unexpectedly changed path
This commit is contained in:
parent
0f9e50b8c5
commit
bc50f2a3f1
2 changed files with 11 additions and 4 deletions
6
error.c
6
error.c
|
@ -2719,8 +2719,10 @@ syntax_error_with_path(VALUE exc, VALUE path, VALUE *mesg, rb_encoding *enc)
|
|||
rb_ivar_set(exc, id_i_path, path);
|
||||
}
|
||||
else {
|
||||
if (rb_attr_get(exc, id_i_path) != path) {
|
||||
rb_raise(rb_eArgError, "SyntaxError#path changed");
|
||||
VALUE old_path = rb_attr_get(exc, id_i_path);
|
||||
if (old_path != path) {
|
||||
rb_raise(rb_eArgError, "SyntaxError#path changed: %+"PRIsVALUE"->%+"PRIsVALUE,
|
||||
old_path, path);
|
||||
}
|
||||
VALUE s = *mesg = rb_attr_get(exc, idMesg);
|
||||
if (RSTRING_LEN(s) > 0 && *(RSTRING_END(s)-1) != '\n')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue