Skip to content

Commit

Permalink
In serve-json-rpc, populate internal-error with exception (#1249)
Browse files Browse the repository at this point in the history
A 2-char patch.. `json-rpc`s `internal-error` can take an optional
(default void) `e` for the error/exception object. Its one call in
`json-rpc` does have an `e` in scope that wasn't passed but probably
should be. Hence this patch!
  • Loading branch information
metaleap authored Jun 16, 2024
1 parent 1f8a942 commit 7aa20c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/std/net/json-rpc.ss
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
;; Use hash so only one of result: or error: shall be printed
(def result (processor method params))
(if notification? (void) (hash ("jsonrpc" jsonrpc) ("id" id) ("result" result)))
(catch (e) (return-error (if (json-rpc-error? e) e (internal-error)))))))
(catch (e) (return-error (if (json-rpc-error? e) e (internal-error (error-message e))))))))

(def (json-rpc-handler/response res log request-json response-json)
(let/cc return
Expand Down

0 comments on commit 7aa20c3

Please sign in to comment.