Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/extend.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,14 @@ a final app is typically not run in development mode, but as a release. In that
moment, semantic errors will help to identify possible problems. Include offsets
and sizes (or `Range`s) for the application to tell exactly where the problem
is, and it can choose to e.g. dump a contextual hex view on the data.

## Additional information

To provide additional information, instead of returning an `Err(String)`, wrap
it in an `enum CustomError`, i.e., for example,
```rs
enum CustomError {
TooSmall(String),
}
```
so you would `return Err(CustomError:TooSmall(format!("{n{ bytes needed")))`.