Skip to content

Commit

Permalink
Include errno_provenance in sys_err messages
Browse files Browse the repository at this point in the history
Helps with debugging nasty issues.
  • Loading branch information
byroot committed Jan 30, 2024
1 parent 34f1be9 commit c88b4bd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ext/bootsnap/bootsnap.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,12 @@ bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler, VALUE args
return output_data;
fail_errno:
CLEANUP;
if (errno_provenance) {
exception_message = rb_str_concat(
rb_str_new_cstr(errno_provenance),
rb_str_concat(rb_str_new_cstr(": "), exception_message)
);
}
exception = rb_syserr_new_str(errno, exception_message);
rb_exc_raise(exception);
__builtin_unreachable();
Expand Down

0 comments on commit c88b4bd

Please sign in to comment.