Fray Engine
Loading...
Searching...
No Matches
errors.hpp File Reference
#include <cstdio>
#include "types.hpp"

Go to the source code of this file.

Namespaces

namespace  fray
namespace  fray::errors

Macros

#define FRAY_ERROR_LIST
 X-macro list of every error code: X(NAME, "description"). Each entry becomes an enumerator of fray::errors::code (values count up from 0 in list order) and a case in description(). The quoted text is the meaning of the code:
#define X(name, desc)
#define X(name, desc)

Typedefs

typedef F_long F_err
 Error return type used across the Engine; the value is a fray::errors::code (0 / NONE means success).

Enumerations

enum  fray::errors::code : F_err { fray::errors::FRAY_ERROR_LIST }
 All Engine error codes, generated from FRAY_ERROR_LIST. NONE is 0 and means success. More...

Functions

const F_char * fray::errors::description (code err)
 Formats an error code as "Error <number>: <description>". Not thread-safe: the text lives in a shared static buffer, so copy it before another call or thread can overwrite it.
const F_char * fray::errors::description (F_err err)
 Overload of description() for a plain F_err value.

Macro Definition Documentation

◆ FRAY_ERROR_LIST

#define FRAY_ERROR_LIST

X-macro list of every error code: X(NAME, "description"). Each entry becomes an enumerator of fray::errors::code (values count up from 0 in list order) and a case in description(). The quoted text is the meaning of the code:

  • NONE: success. GENERAL: unspecified failure. FLAG_1..FLAG_9: generic numbered flag errors.
  • FAILED_SET_STATE, INVALID_APPLICATION_ID, FAILED_SAVE/LOAD/REMOVE_STATE, STATE_NOT_FOUND, INVALID_STATE_KEY, STATE_TYPE_MISMATCH, STATE_VALUE_OUT_OF_RANGE, FAILED_RENAME_STATE_TABLE: state store key/value failures.
  • FAILED_OPEN_STORE, FAILED_CLOSE_STORE, FAILED_HISTORY: store (database) and project history failures.
  • FAILED_OPEN/SAVE/CLOSE/RENAME_PROJECT, PROJECT_CONFLICT, PROJECT_ALREADY_OPEN, DATABASE_CONFLICT, PROJECT_FOLDER/ARCHIVE_EXISTS, PROJECT_BOTH_EXIST, PROJECT_NOT_FOUND, INVALID_PROJECT_DATABASE, PROJECT_DATABASE_OCCUPIED, PROJECT_AMBIGUOUS: project lifecycle and on-disk layout failures.
  • NO_MESSAGE_ROUTER, INVALID_MESSAGE, MESSAGE_TOO_LARGE, UNSUPPORTED_MESSAGE_VERSION: messaging failures.
  • FAILED_START, FAILED_SPAWN_PROCESS: process start-up failures.

Definition at line 34 of file errors.hpp.

◆ X [1/2]

#define X ( name,
desc )
Value:
case code::name: \
snprintf(buffer, sizeof(buffer), "Error %lld: %s", static_cast<F_longlong>(code::name), desc); \
return buffer;
int64_t F_longlong
Signed 64-bit integer.
Definition types.hpp:38

Definition at line 85 of file errors.hpp.

◆ X [2/2]

#define X ( name,
desc )
Value:
name,

Definition at line 85 of file errors.hpp.

Typedef Documentation

◆ F_err

typedef F_long F_err

Error return type used across the Engine; the value is a fray::errors::code (0 / NONE means success).

Definition at line 13 of file errors.hpp.