-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unify way of printing exceptions from within fibers #6594
Conversation
73ceedc
to
cc9e39d
Compare
Weird, CI flunked (but just once) with the error below:
|
This CI error happens infrequently. Don't know why. It's not related to this PR at least. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe puts
everywhere would be better?
@straight-shoota Out of these two I prefer |
I believe it's related to one of these: crystal/spec/std/signal_spec.cr Lines 5 to 7 in 5e059ab
|
Without a line break, this can become a pretty long line (consider a long fiber name and error message) and more difficult to read. I'd prefer to add a line break after the "Unhandled exception" part. |
I disagree, lines are longer by the size of "Unhandled exception: " string (which IMO is not much) and long names are seldom assigned to fibers, if at all (there are none in most of the cases).
vs
Option no. 1 is more readable to me. Also, I'd prefer not to change already established format, just because of how an edge-case might affect it ( |
Could this be reviewed and possibly included in the upcoming 0.26.1 release? It's a small change so it shoudn't take much time to get through it. @RX14 @bcardiff @ysbaddaden @asterite ? |
Anyone care for 2nd review? 🏓 @asterite @sdogruyol |
There was slight inconsistency how these exceptions were printed to
STDERR
(puts
vsprint
), now they should be even. I've also addedSTDERR.flush
missing fromAtExitHandlers.run
.For the reference:
crystal/src/kernel.cr
Lines 404 to 405 in 5e059ab
vs
crystal/src/fiber.cr
Lines 122 to 128 in 5e059ab