Error Codes (Including Warnings)
More...
#include "log_global.h"
#include "meta.h"
#include "term.h"
#include <cassert>
#include <iostream>
#include <string>
#include <type_traits>
Go to the source code of this file.
|
enum class | Err : int {
SUCCESS = 0
, CLI_OPTIONS = 100
, NO_GUI
, INPUT_NOT_EXISTS
,
UNKOWN_CMD
, OUTPUT_FILE_EXISTS
, CANNOT_OPEN_OUTPUT_FILE
, YAML_SYNTAX
,
YAML_DTYPE
, VERSION_STRING_ERROR
, TOO_MANY_TX
, TOO_MANY_RX
,
ASTYLE_ERROR
, COMPILE_ERROR
, SIMULATE_ERROR
, CONFIG_ERROR
,
CANNOT_COPY_FROM_INCLUDE
, ALG_EXPORT_ESTIMATION
, ALG_EXPORT_GEN_BF
, ALG_EXPORT_ALGORITHM
,
VERSION_NOT_SPECIFIED = 200
} |
| Error Code. More...
|
|
|
static int | errorCode (const Err &e) noexcept |
| Return the integer of the error code from class Err. More...
|
|
static std::string | errorMsg (const Err &e) noexcept |
| Return the error message of the error code from class Err. More...
|
|
static bool | isError (const Err &e) noexcept |
| Check if the error code corresponds to an error. More...
|
|
static bool | isWarning (const Err &e) noexcept |
| Check if the error code corresponds to a warning. More...
|
|
static bool | isSuccess (const Err &e) noexcept |
| Check if the error code corresponds to a warning. More...
|
|
static void | errorExit (const Err &e, bool show_error=true) noexcept |
| Print error message and exit with exit code. More...
|
|
Error Codes (Including Warnings)
- Author
- Wuqiong Zhao (wqzha.nosp@m.o@se.nosp@m.u.edu.nosp@m..cn)
- Version
- 0.3.0
- Date
- 2024-01-21
- Copyright
- Copyright (c) 2022-2024 Wuqiong Zhao (Teddy van Jerry)
◆ Err
Error Code.
Each error has its corresponding error. It is worth noting that SUCCESS is also listed here.
Enumerator |
---|
SUCCESS | |
CLI_OPTIONS | |
NO_GUI | |
INPUT_NOT_EXISTS | |
UNKOWN_CMD | |
OUTPUT_FILE_EXISTS | |
CANNOT_OPEN_OUTPUT_FILE | |
YAML_SYNTAX | |
YAML_DTYPE | |
VERSION_STRING_ERROR | |
TOO_MANY_TX | |
TOO_MANY_RX | |
ASTYLE_ERROR | |
COMPILE_ERROR | |
SIMULATE_ERROR | |
CONFIG_ERROR | |
CANNOT_COPY_FROM_INCLUDE | |
ALG_EXPORT_ESTIMATION | |
ALG_EXPORT_GEN_BF | |
ALG_EXPORT_ALGORITHM | |
VERSION_NOT_SPECIFIED | |
◆ errorCode()
static int errorCode |
( |
const Err & |
e | ) |
|
|
inlinestaticnoexcept |
Return the integer of the error code from class Err.
- Parameters
-
- Returns
- int (The error code.)
◆ errorExit()
static void errorExit |
( |
const Err & |
e, |
|
|
bool |
show_error = true |
|
) |
| |
|
inlinestaticnoexcept |
Print error message and exit with exit code.
- Parameters
-
◆ errorMsg()
static std::string errorMsg |
( |
const Err & |
e | ) |
|
|
inlinestaticnoexcept |
Return the error message of the error code from class Err.
- Parameters
-
- Returns
- std::string (The error message.)
◆ isError()
static bool isError |
( |
const Err & |
e | ) |
|
|
inlinestaticnoexcept |
Check if the error code corresponds to an error.
- Parameters
-
- Return values
-
true | This is not an error. |
false | This is a real error. |
◆ isSuccess()
static bool isSuccess |
( |
const Err & |
e | ) |
|
|
inlinestaticnoexcept |
Check if the error code corresponds to a warning.
This is used to check if it is Err::SUCCESS.
- Parameters
-
- Return values
-
true | This is success. |
false | This is not success. |
◆ isWarning()
static bool isWarning |
( |
const Err & |
e | ) |
|
|
inlinestaticnoexcept |
Check if the error code corresponds to a warning.
- Parameters
-
- Return values
-
true | This is not a warning. |
false | This is a real warning. |