1
0
Fork 0

- [JSONRPC] used a custom error when a called function fails for some reason.

This commit is contained in:
cage 2023-01-06 12:15:54 +01:00
parent 4fb9c6eb43
commit 7fc90b428c
1 changed files with 7 additions and 3 deletions

View File

@ -411,10 +411,14 @@
:error-object (make-response-error (or (code e)
(response-error-code +error-invalid-request+))
(text e))))
(make-internal-error (e &optional (id nil))
(make-internal-error (e)
(make-response nil
nil
:error-object (make-internal-error-message (format nil "~a" e))))
(make-failed-function-error (e id)
(make-response nil
id
:error-object (make-internal-error-message (format nil "~a" e)))))
:error-object (make-failed-function-call-error-message (format nil "~a" e)))))
(handler-case
(multiple-value-bind (method id params)
(displace-single-request request)
@ -430,7 +434,7 @@
(make-rpc-error e))
(error (e)
(maybe-log-message (format nil "jsonrpc request failed: ~a" e))
(make-internal-error e id))))
(make-failed-function-error e id))))
(json-rpc-error (e)
(make-rpc-error e))
(error (e)