Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace string with a structured error in CONTRACT_ERROR & TRANSACTION_EXECUTION_ERROR #219

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions api/starknet_api_openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
Expand All @@ -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"]
Expand Down