Skip to content

Refactor error handling to user, fatal, and external errors #285

@fxamacker

Description

@fxamacker

Issue To Be Solved

Error handling and error passing between Atree, Cadence, and FVM needs to be improved.

Currently Atree errors are either fatal or non-fatal errors. Some external errors from FVM or Cadence are wrapped as fatal errors, which could be user errors instead, such as reaching interaction limit.

Suggested Solution

Refactor Atree error handling to 3 categories: user, fatal, and external errors. User errors are recoverable such as index out of bounds. Fatal errors are unrecoverable such as failing Atree data integrity check. External errors are wrapped errors from either FVM or Cadence. External errors should be handled by FVM or Cadence with more context.

Also make sure all Atree external errors implement Unwrap for idiomatic error handling.

Context

See onflow/cadence#1255

Metadata

Metadata

Assignees

Labels

E&V TeamExecution / Verification / Edge TeamenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions