Skip to content

S1 Inconsistent Error Handling Patterns Across Connectors #111

@nialexsan

Description

@nialexsan

File(s) affected:

  • cadence/contracts/connectors/evm/ERC4626SinkConnectors.cdc
  • cadence/contracts/connectors/evm/EVMTokenConnectors.cdc
  • cadence/contracts/connectors/evm/UniswapV3SwapConnectors.cdc
  • cadence/contracts/connectors/evm/ERC4626SwapConnectors.cdc

Description: The code-base uses inconsistent error handling strategies:

Panic on error:
ERC4626SinkConnectors.depositCapacity() panics when deposit fails

Silent early return:
EVMTokenConnectors.Sink.depositCapacity() returns early without error when fees are insufficient

Return nil/0.0:
Quote functions return zero values to indicate issues

This inconsistency makes it difficult for clients to:

  • Predict behavior across different connectors
  • Handle errors appropriately
  • Debug issues when things go wrong.

Recommendation:
Establish and document consistent error handling patterns across connectors.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request⎈ QuantStampThis label indicates that this item is related to Quantstamp review

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions