Skip to content
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

Make raise facades macros #922

Merged
merged 11 commits into from
Sep 25, 2023
Merged

Make raise facades macros #922

merged 11 commits into from
Sep 25, 2023

Conversation

vyzo
Copy link
Collaborator

@vyzo vyzo commented Sep 24, 2023

Adds macros raise/context and defraise/context to aid capturing exception contexts, and uses them in the stdlib.
So that we have exception context everywhere!

@vyzo vyzo requested a review from fare September 24, 2023 17:32
@netlify
Copy link

netlify bot commented Sep 24, 2023

Deploy Preview for elastic-ritchie-8f47f9 ready!

Name Link
🔨 Latest commit ac6b07a
🔍 Latest deploy log https://app.netlify.com/sites/elastic-ritchie-8f47f9/deploys/651151b422759f00086d06c2
😎 Deploy Preview https://deploy-preview-922--elastic-ritchie-8f47f9.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@vyzo vyzo requested a review from a team September 24, 2023 17:32
@vyzo
Copy link
Collaborator Author

vyzo commented Sep 24, 2023

Obligatory demo:

Gerbil 0.17.0-293-g70222be9 on Gambit v4.9.5-40-g24201248
> (import :std/misc/timeout)
> (make-timeout "foo")
*** ERROR IN (stdin)@2.1 -- 
*** ERROR IN "misc/timeout.ss"@15.25 [BadArgument]: Bad argument; expected real, time or #f
--- irritants: make-timeout "foo" 
--- continuation backtrace:
0  raise                                                                              
1  (interaction)                                                                      (stdin)@2:1                                                                        (std/misc/timeout#make-timeout "foo")

Copy link
Collaborator

@drewc drewc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where: (exception-context message) is so simple yet such a great feature!!

@vyzo vyzo changed the title Make raise- facades macros Make raise facades macros Sep 25, 2023
Comment on lines +132 to +135
(let (message
(if (string? message)
message
(call-with-output-string "" (cut display message <>))))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a sanity check, as we send the message over the wire for actor error results and a bug could end up something unintended; this is guaranteed to be a string now.

@vyzo vyzo merged commit 4e07779 into master Sep 25, 2023
@vyzo vyzo deleted the raise-context branch September 25, 2023 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants