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

fix(connector-besu): error handling of DeployContractSolidityBytecodeEndpoint #2869

Conversation

petermetz
Copy link
Contributor

@petermetz petermetz commented Nov 9, 2023

  1. Uses the new utility function from the core package in the catch block
    so that HTTP statusCode is matching the intent of the thrower (e.g.
    correctly differentiates between user-error and developer error)
  2. Updates the deployContract method of the besu connector so that it
    correctly specifies the intent of the errors thrown as either user error
    or developer error via setting the statusCode property of the HTTP errors
    to either 4xx or 5xx depending on the cause.
  3. Provides a template for future similar changes (of which we'll need
    dozens to update all the REST API endpoints)

Depends on #2868

Related to but does not conclude: #1747

Signed-off-by: Peter Somogyvari [email protected]

@petermetz petermetz enabled auto-merge (rebase) November 9, 2023 21:33
@petermetz petermetz changed the title Fix-rest-endpoint-error-handling-pattern-besu-deploy-contract-solidity-bytecode-endpoint fix(connector-besu): error handling of DeployContractSolidityBytecodeEndpoint Nov 9, 2023
Copy link

This PR/issue depends on:

…Endpoint

1. Uses the new utility function from the core package in the catch block
so that HTTP `statusCode` is matching the intent of the thrower (e.g.
correctly differentiates between user-error and developer error)
2. Updates the `deployContract` method of the besu connector so that it
correctly specifies the intent of the errors thrown as either user error
or developer error via setting the `statusCode` property of the HTTP errors
to either 4xx or 5xx depending on the cause.
3. Provides a template for future similar changes (of which we'll need
dozens to update all the REST API endpoints)

Depends on hyperledger-cacti#2868

Related to but does not conclude: hyperledger-cacti#1747

Signed-off-by: Peter Somogyvari <[email protected]>
@petermetz petermetz force-pushed the fix-rest-endpoint-error-handling-pattern-besu-deploy-contract-solidity-bytecode-endpoint branch from 5816904 to 4efc773 Compare November 15, 2023 23:59
@petermetz petermetz requested a review from outSH as a code owner November 15, 2023 23:59
@petermetz petermetz merged commit 89d9b93 into hyperledger-cacti:main Nov 16, 2023
25 of 69 checks passed
@petermetz petermetz deleted the fix-rest-endpoint-error-handling-pattern-besu-deploy-contract-solidity-bytecode-endpoint branch November 16, 2023 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants