Skip to content

Commit 15baddc

Browse files
committed
Add internal_error atom to defaultatoms.def
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]>
1 parent c95a07b commit 15baddc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libAtomVM/defaultatoms.def

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ X(EXIT_ATOM, "\x4", "EXIT")
8282
X(BADMAP_ATOM, "\x6", "badmap")
8383
X(BADKEY_ATOM, "\x6", "badkey")
8484
X(NONE_ATOM, "\x4", "none")
85+
X(INTERNAL_ERROR_ATOM, "\xE", "internal_error")
8586

8687
X(IO_REQUEST_ATOM, "\xA", "io_request")
8788
X(IO_REPLY_ATOM, "\x8", "io_reply")

0 commit comments

Comments
 (0)