Typed error taxonomy for supervise RPC dispatch #275
Reference in New Issue
Block a user
Delete Branch "typed-rpc-error-taxonomy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #253.
Summary
_RpcClientErrorand_RpcInternalErroras typed subclasses of_RpcError, giving the dispatcher a formal vocabulary for bad-request vs server-fault conditionsraise _RpcError(...)call sites inparse_jsonrpc,validate_proposed_file,handle_tools_call, and_dispatchconverted to_RpcClientErrorwrite_proposalandarchive_proposalIO calls wrapped to catchOSErrorand re-raise as_RpcInternalErrorwith the cause attacheddo_POSTdispatch error handling split into three explicit branches: client errors (returned verbatim, no logging), internal errors (logged at ERROR with cause, returnsERR_INTERNAL), and bare exceptions (logged as unexpected, returnsERR_INTERNAL)_RpcInternalErrorescalation, and the HTTP-levelERR_INTERNALresponseChanged files:
bot_bottle/supervise_server.py,tests/unit/test_supervise_server.py10fd5c961etod99dba037c