Skip to content

[CONTRACT] Implement Error Handling Module #245

@truthixify

Description

@truthixify

Description:
Create an errors.rs file to define a centralized Error enum for all AssetsUp contracts, ensuring consistent error handling.

Tasks:

  • Create src/errors.rs with an Error enum including:
    • AssetAlreadyExists
    • AssetNotFound
    • BranchAlreadyExists
    • BranchNotFound
    • SubscriptionAlreadyExists
    • Unauthorized
    • InvalidPayment
  • Use #[contracttype] for the Error enum.
  • Add documentation for each error case.
  • Export the Error enum for use in other modules.
  • Update lib.rs to include errors.rs as a module.
  • Write a test to verify error handling in a dummy function.

Acceptance Criteria:

  • errors.rs defines a comprehensive Error enum with #[contracttype].
  • Errors are documented and exported.
  • Module compiles without errors.
  • A test confirms that a dummy function returns an error correctly.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions