Skip to content

Conversation

@mariari
Copy link
Member

@mariari mariari commented Oct 1, 2025

I decided to help out with the better error handling efforts.

Please read the message on the commit messages. Each commit is minimal to be understood, and can be torn apart. I.E. if there are changes that are not wanted, it should be easy to cut out a particular change and deal with minor issues when rearranging the commits.

The PR is not ready, but the commits can be reviewed as is

V0.7.0 introduces the Digest types and converts Vecs into fixed sized
arrays
This allows us to decode directly into a Binary saving us if we wish
to convert it to some other type than always going through Vec<u8>
which will encur another copy
@mariari mariari force-pushed the mariari/better-error-handling branch from 62ca643 to 8bfcd43 Compare October 2, 2025 09:48
This is helpful as often we need to serialize bincode data, and having
a uniform way to handle the error type lets us not worry about doing
these conversions by hand.
Unwraps that don't change signatures are now converted to being
safer. However this is not everything and further work is
required. Namely tests are not converted, this would normally be fine,
but tests are exported to Elixir and thus have a chance to crash the
VM.

Further functions like:

tests::create_an_action

Have non Result outputs, meaning greater refactoring is required to
handle these.
@mariari mariari force-pushed the mariari/better-error-handling branch 3 times, most recently from 03930e8 to e900d68 Compare October 2, 2025 10:59
Doing this improperly can crash the Erlang VM. Every instnace of this
where the end type is a result type or something analygous (like the
Term<'a> type) now is expectless.

More work needs to be done for functions that do not fit this
architype which is 13 methods in arm/src
@mariari mariari force-pushed the mariari/better-error-handling branch from e900d68 to b4d5b6c Compare October 2, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants