|
Leonardus
|
Error handling. More...
#include <string>#include <cstdint>#include <source_location>
Include dependency graph for error.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | ERRPRAEFIX "leo" |
| Praefix for error messages of second pass. | |
Enumerations | |
| enum | OpError : std::uint8_t { _invalid , success , invalidexit , rangecheck , stackunderflow , typecheck , unmatchedmark , dictstackunderflow , undefinedresult , undefined , invalidfileaccess , undefinedfilename , ioerror } |
| Operator error code enum. More... | |
| enum | InError : std::uint8_t { cmdline , parsererror , semantics , internal } |
| Interpreter error code enum. More... | |
Functions | |
| void | opErrExit (OpError p_err, const std::string &p_details="", const std::source_location p_location=std::source_location::current()) |
| Write operator error message to interpreter out file and exit( EC_OPERATOR ). | |
| void | inErrExit (InError p_err, const std::string &p_details="", const std::source_location p_location=std::source_location::current()) |
| Write interpreter error message to interpreter out file and exit( EC_INTERPRETER / EC_CMDLINE ). | |
| void | panicExit (const char *p_msg1, const char *p_msg2=nullptr) |
| Panic exit( EC_PANIC ). | |
Error handling.
Leonardus, a minimalist stack-based programming system. Copyright (C) 2025 Andreas Muckenschnabel This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
| enum InError : std::uint8_t |
Interpreter error code enum.
| enum OpError : std::uint8_t |
Operator error code enum.
| void inErrExit | ( | InError | p_err, |
| const std::string & | p_details = "", |
||
| const std::source_location | p_location = std::source_location::current() |
||
| ) |
Write interpreter error message to interpreter out file and exit( EC_INTERPRETER / EC_CMDLINE ).
| [in] | p_err | Interpreter error code. |
| [in] | p_details | Details to add in message output. |
| [in] | p_location | A paramter to hold std::source_location::current(). Never set explicitly. |
| void opErrExit | ( | OpError | p_err, |
| const std::string & | p_details = "", |
||
| const std::source_location | p_location = std::source_location::current() |
||
| ) |
Write operator error message to interpreter out file and exit( EC_OPERATOR ).
| [in] | p_err | Operator error code. |
| [in] | p_details | Details to add in message output. |
| [in] | p_location | A paramter to hold std::source_location::current(). Never set explicitly. |
| void panicExit | ( | const char * | p_msg1, |
| const char * | p_msg2 = nullptr |
||
| ) |
Panic exit( EC_PANIC ).
| [in] | p_msg1 | First message. |
| [in] | p_msg2 | Second message. Defaults to nullptr. |