From 15baddc73b3c06c1e2238836a396e0359659fc53 Mon Sep 17 00:00:00 2001 From: Winford Date: Mon, 30 Dec 2024 01:26:09 +0000 Subject: [PATCH] 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 --- src/libAtomVM/defaultatoms.def | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libAtomVM/defaultatoms.def b/src/libAtomVM/defaultatoms.def index 2f1d2949d..bb20b9ee4 100644 --- a/src/libAtomVM/defaultatoms.def +++ b/src/libAtomVM/defaultatoms.def @@ -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")