Skip to content

Error codes for deterministic runtime failures #13

@0Xsolcreator

Description

@0Xsolcreator

I noticed that in some cases (e.g., when slippage >= 100 or when a pool has no liquidity), the SDK also currently fails at runtime with generic errors (e.g. division by zero, undefined). These are deterministic cases that can be caught earlier and could benefit from standardized error handling.

Questions:

  • Is there a plan to introduce standardized error codes / error classes for such cases?

  • If not, would you be open to contributions (PRs) that add them? For example:

     ERR_INVALID_SLIPPAGE
     
     ERR_NO_LIQUIDITY
     
     ERR_POOL_NOT_FOUND
    

@khiemsoft

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions