Changeset 40027 in project


Ignore:
Timestamp:
04/17/21 20:50:43 (4 weeks ago)
Author:
rgherdt
Message:

Expand API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/json-rpc

    r40024 r40027  
    5656JSON-RPC 2.0 demands that all requests are answered. This functions loops over {{input-port}} and answers to the requests through {{output-port}} using the handlers defined in {{json-rpc-handler-table}}.
    5757
     58===== Error handling
     59
     60User-created errors are meant to be raised by handlers defined in {json-rpc-handler-table}, and are properly delivered to the calling process according to the JSON-RPC protocol.
     61
     62<parameter>(custom-error-codes)</parameter>
     63
     64JSON-RPC supports custom server-side error codes. This parameter defines an alist mapping custom error names ({symbol}s) to error codes ({integer}) ranging between -32000 and -32099.
     65
     66<procedure>(make-json-rpc-custom-error error-symbol [msg])</procedure>
     67
     68Create an error instance of {error-symbol} ({symbol}) with an optional {msg} ({string}). It's an error if {error-type} isn't defined in {custom-error-codes}.
     69
     70<procedure>(make-json-rpc-internal-error)</procedure>
     71
     72Create a generic error object.
     73
     74<procedure>(json-rpc-error? condition)</procedure>
     75<procedure>(json-rpc-custom-error? condition)</procedure>
     76<procedure>(json-rpc-internal-error? condition)</procedure>
     77
     78Predicates for several error objects.
     79
    5880=== Examples
    5981
     
    104126=== Version History
    105127
    106 * 0.0.1 Initial version.
     128* 0.1 Initial version.
    107129
Note: See TracChangeset for help on using the changeset viewer.