From bc8e51dc1ce749b5b5f17f187f53d70d69e64876 Mon Sep 17 00:00:00 2001 From: Josh Klopfenstein Date: Tue, 19 Dec 2023 15:02:13 -0600 Subject: [PATCH] Ensure `resource busy` errors are tracked in metrics (#1585) Only ErrInternal is tracked in our metrics, and the starknet_call was not returning an ErrInternal on ResourceBusy errors. --- rpc/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/handlers.go b/rpc/handlers.go index dbd55acc96..10d1eb8da1 100644 --- a/rpc/handlers.go +++ b/rpc/handlers.go @@ -1213,7 +1213,7 @@ func (h *Handler) Call(call FunctionCall, id BlockID) ([]*felt.Felt, *jsonrpc.Er call.Calldata, blockNumber, header.Timestamp, state, h.network) if err != nil { if errors.Is(err, utils.ErrResourceBusy) { - return nil, ErrUnexpectedError.CloneWithData(err.Error()) + return nil, ErrInternal.CloneWithData(err.Error()) } return nil, makeContractError(err) }