You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What kind of API would be useful for handling errors with pcase?
One peculiarity with plz error handling that I've noticed in
hyperdrive.el is that synchronous code deals with full errors like this:
;; (plz-error "Curl error" #s(plz-error (7 . "Failed to connect to host.") nil nil))
;; (plz-error "HTTP error" #s(plz-error nil #s(plz-response 1.1 404 ((content-type . "text/plain;charset=UTF-8") (date . "Thu, 07 Sep 2023 02:15:36 GMT") (connection . "keep-alive") (keep-alive . "timeout=5")) "") nil))
whereas asynchronous code deals with just the plz error struct that
might be passed as the DATA argument to `signal`.
Perhaps the pcase-defmacro could help avoid the awkward use of `caddr`
to get the plz-error struct before it can be destructured, e.g.
<https://git.sr.ht/~ushin/hyperdrive.el/tree/e88112f2d2e44b7450450679bff183f33ba9519a/item/hyperdrive-lib.el#L396>.
Not sure about the specifics, but it might be nice to use a custom
pcase-defmacro
expander to help with writing error handling inplz
-related code.cc: @josephmturner
The text was updated successfully, but these errors were encountered: