identity-wallet icon indicating copy to clipboard operation
identity-wallet copied to clipboard

Make `AppError` extensible

Open nanderstabel opened this issue 1 year ago • 0 comments

Description

The goal is to make the error handling and logging extensible to match extensions in other parts of the app. Currently we have implemented the thiserror crate to create our own custom errors as shown in the enum in the error.rs file.

We will add an ExtensionError variant with a dynamic message. This will be the only error to be used in the extension. This way it will remain clear exactly in what part of the code the error occurs. The thiserror crate has the capability of merging errors as well. We will further explore this possibility so that the standard errors can still be easily used in the extensions in combination with the ExtensionError.

Motivation

The motivation is the make our app as a whole easily extensible, therefore also error handling must be extensible. The result is an easily extensible error handling mechanism while maintaining clear isolation of error origins. This should keep locating errors as clear as it could be.

Resources

n/a

To-do List

  • [ ] Add the dynamic ExtensionError to the enum in error.rs
  • [ ] Test this Error
  • [ ] Test the Error merging possibilities
  • [ ] Add examples and guidelines

nanderstabel avatar Jan 22 '24 10:01 nanderstabel