Implementation of error handling.
More...
#include <string>
#include <cstdlib>
#include <unistd.h>
#include <cstring>
#include "dry.h"
#include "error.h"
#include "interpreterservice.h"
|
| void | opErrExit (OpError p_err, const std::string &p_details, const std::source_location p_location) |
| | 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) |
| | Write interpreter error message to interpreter out file and exit( EC_INTERPRETER / EC_CMDLINE ).
|
| |
| void | panicExit (const char *p_msg1, const char *p_msg2) |
| | Panic exit( EC_PANIC ).
|
| |
Implementation of error handling.
- Copyright
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/.
◆ inErrExit()
| 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 ).
- Parameters
-
| [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. |
◆ opErrExit()
| 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 ).
- Parameters
-
| [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. |
◆ panicExit()
| void panicExit |
( |
const char * |
p_msg1, |
|
|
const char * |
p_msg2 = nullptr |
|
) |
| |
Panic exit( EC_PANIC ).
- Parameters
-
| [in] | p_msg1 | First message. |
| [in] | p_msg2 | Second message. Defaults to nullptr. |