Skip to content

ReadError and WriteError should support custom errors #14

@qkniep

Description

@qkniep

Currently, there seems to be no support for throwing custom error types. This is useful for any type that needs to do arbitrary verification during (de)serialization, e.g. a signature type that needs to check whether the point is on the elliptic curve.

There should probably be a way to throw custom ReadErrors and WriteErrors, e.g. by using map_err() on some error type within the implementations of SchemaRead::read() and SchemaWrite::write(). This is analogous to this use case in serde: https://serde.rs/convert-error.html

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