Skip to content

Commit

Permalink
Add internal_error atom to defaultatoms.def
Browse files Browse the repository at this point in the history
Adds the `internal_error` atom from OTP for returning errors for "thing that shouldn't happen".
There are rare occasions where user inputs may be valid, but an internal operation fails for some
reason (potentially an internal bug to the VM, not the users application code). For example, this
may be an invalid internal state when setting the direction for a gpio pin. If the users inputs are
valid `internal_error` should be returned rather than `badarg`, which could mislead application
developers into chasing a bug in their application that isn't there.

Signed-off-by: Winford <[email protected]>
  • Loading branch information
UncleGrumpy committed Dec 30, 2024
1 parent c95a07b commit 15baddc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libAtomVM/defaultatoms.def
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ X(EXIT_ATOM, "\x4", "EXIT")
X(BADMAP_ATOM, "\x6", "badmap")
X(BADKEY_ATOM, "\x6", "badkey")
X(NONE_ATOM, "\x4", "none")
X(INTERNAL_ERROR_ATOM, "\xE", "internal_error")

X(IO_REQUEST_ATOM, "\xA", "io_request")
X(IO_REPLY_ATOM, "\x8", "io_reply")
Expand Down

0 comments on commit 15baddc

Please sign in to comment.