Find a file
arnaucube 29545f03fc
migrate from anyhow to thiserror (#197)
* migrate from anyhow to thiserror (#190). pending polish error msgs

* Add backtrace and compartmentalize errors

- Include backtraces in the errors we generate.  To get this we can't
  just return a literal enum, because the backtrace requires a call.
- Related to the previous point: add methods to create errors so
  we can include the backtrace conveniently without changing too much
  the syntax.  So instead of `Err(Error::KeyNotFound(key))` (literal
  enum) it will be `Err(Error::key_not_found(key))` (method call)
- Each error should be local to its scope, and each scope should
  only return its own error.
  - The merkle tree should return `TreeError` and not Error
  - The middleware should return `MiddlewareError` and not Error
- With a global Error we can't easily include backend/frontend types in
  the error fields, so declare a `BackendError` and a `FrontendError`
  and follow the pattern from the previous point
- The Pod traits should be able to return backend errors and will be
  used in the frontend; for that we change them to use trait object
  Error: `dyn std::error::Error`

* fix error

* apply suggestions from @arnaucube

* rename XError and XResult to Error and Result

* reorg signature

* make frontend custom error more ergonomic

* remove unnecessary feature

---------

Co-authored-by: Eduard S. <eduardsanou@posteo.net>
2025-04-22 15:07:04 +02:00
.github/workflows Refactor frontend/middleware types (#194) 2025-04-16 11:59:30 +02:00
book complete full zukyc example doc (#172) 2025-04-04 12:00:57 -07:00
src migrate from anyhow to thiserror (#197) 2025-04-22 15:07:04 +02:00
.gitignore Aard custom (#49) 2025-02-24 09:05:30 -08:00
Cargo.toml migrate from anyhow to thiserror (#197) 2025-04-22 15:07:04 +02:00
README.md Featurize middleware types that are actually defined by the backend (#94) 2025-02-27 14:15:31 +01:00
rust-analyzer.toml chore(qol): add rust-analyzer.toml (#187) 2025-04-08 08:33:49 +10:00
rust-toolchain.toml Add clippy (#191) 2025-04-08 11:52:02 -07:00
rustfmt.toml Organize imports (#188) 2025-04-07 16:19:13 -07:00

POD2

Usage

  • Run tests: cargo test --release
  • Rustfmt: cargo fmt
  • Check typos: typos -c .github/workflows/typos.toml

Book

The book contains the specification of POD2. A rendered version of the site can be found at: https://0xparc.github.io/pod2/

To run it locally:

  • Requirements
  • Go to the book directory: cd book
  • Run the mdbook: mdbook serve