Print errors by calling mrb_print_backtrace() without backtrace#5858
Merged
Conversation
- In case of `NoMemoryError` exceptions, the error message is now printed directly. - Replaced `mrb_p()` used by mruby#4250 with `mrb_print_error()`. ref. squashed commit f1523d2 ref. subcommit da7d7f8 ref. subcommit d9c7b6b
Contributor
Author
|
matz
reviewed
Nov 20, 2022
| fwrite(RSTRING_PTR(mesg), RSTRING_LEN(mesg), 1, stderr); | ||
| fputc('\n', stderr); | ||
| else { | ||
| fprintf(stderr, "%s:0: ", "(unknown)"); |
Member
There was a problem hiding this comment.
Do we need fprintf() here? It's a static string.
Member
There was a problem hiding this comment.
Nevermind. I will work on removing fprintf() later.
matz
reviewed
Nov 20, 2022
|
|
||
| if (exc == mrb->nomem_err) { | ||
| static const char nomem[] = "Out of memory (NoMemoryError)\n"; | ||
| fwrite(nomem, sizeof(nomem) - 1, 1, stderr); |
Member
There was a problem hiding this comment.
I prefer no spaces around -. Just my preference.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In case of
NoMemoryErrorexceptions, the error message is now printed directly.Replaced
mrb_p()used by Fix problems withmrb_open()if occurs out of memory #4250 withmrb_print_error().ref. squashed commit f1523d2
ref. subcommit da7d7f8
ref. subcommit d9c7b6b
I don't remember for sure, but I think I used
mrb_p()in #4250 because it sometimes didn't output and that was also the case before the change in commit da7d7f8.