From ef205bddaaa1f0e5858a57643abe58432e5c802e Mon Sep 17 00:00:00 2001 From: Ariel Elperin Date: Thu, 25 Jul 2024 12:28:52 +0300 Subject: [PATCH 1/2] add structed error --- api/starknet_api_openrpc.json | 38 +++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/api/starknet_api_openrpc.json b/api/starknet_api_openrpc.json index a5f1791..a19bdff 100644 --- a/api/starknet_api_openrpc.json +++ b/api/starknet_api_openrpc.json @@ -3682,6 +3682,36 @@ "node" ] } + }, + "CONTRACT_EXECUTION_ERROR": { + "description": "structured error that can later be processed by wallets or sdks", + "titel": "contract execution error", + "oneOf": [ + { + "type": "object", + "title": "inner call", + "description": "error frame", + "properties": { + "contract_address": { + "$ref": "#/components/schemas/ADDRESS" + }, + "class_hash": { + "$ref": "#/components/schemas/FELT" + }, + "selector": { + "$ref": "#/components/schemas/FELT" + }, + "error": { + "$ref": "#/components/schemas/CONTRACT_EXECUTION_ERROR" + } + } + }, + { + "title": "error message", + "description": "the error raised during execution", + "type": "string" + } + ] } }, "errors": { @@ -3734,8 +3764,8 @@ "properties": { "revert_error": { "title": "revert error", - "description": "a string encoding the execution trace up to the point of failure", - "type": "string" + "description": "the execution trace up to the point of failure", + "$ref": "#/components/schemas/CONTRACT_EXECUTION_ERROR" } }, "required": "revert_error" @@ -3755,8 +3785,8 @@ }, "execution_error": { "title": "revert error", - "description": "a string encoding the execution trace up to the point of failure", - "type": "string" + "description": "theĀ§ execution trace up to the point of failure", + "$ref": "#/components/schemas/CONTRACT_EXECUTION_ERROR" } }, "required": ["transaction_index", "execution_error"] From 6feb690452b849b6edf940bfd7acec97c8489cd5 Mon Sep 17 00:00:00 2001 From: Ariel Elperin Date: Thu, 19 Sep 2024 15:09:51 +0300 Subject: [PATCH 2/2] typo --- api/starknet_api_openrpc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/starknet_api_openrpc.json b/api/starknet_api_openrpc.json index a19bdff..cc02a1e 100644 --- a/api/starknet_api_openrpc.json +++ b/api/starknet_api_openrpc.json @@ -3785,7 +3785,7 @@ }, "execution_error": { "title": "revert error", - "description": "theĀ§ execution trace up to the point of failure", + "description": "the execution trace up to the point of failure", "$ref": "#/components/schemas/CONTRACT_EXECUTION_ERROR" } },