VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::Error Struct Reference

One failure: a code to branch on, text for the log, and an optional translation key. More...

#include <Result.hpp>

Static Public Member Functions

static Error NotFound (std::string detail)
 
static Error NotReady (std::string detail)
 
static Error Invalid (std::string detail)
 
static Error Denied (std::string key)
 
static Error Immune (std::string key)
 
static Error Unsupported (std::string detail)
 
static Error Engine (std::string detail)
 
static Error Failed (std::string detail)
 

Public Attributes

ErrorCode Code = ErrorCode::Failed
 
std::string Detail
 
std::string Key
 
std::string Text
 

Detailed Description

One failure: a code to branch on, text for the log, and an optional translation key.

Detail is operator-facing and never translated - it names offsets, convars, and SQL state. Key is the translation key a player-facing reply uses; it is empty whenever the failure has nothing sensible to say to a player. A handler that replies looks at Key, logs Detail, and does not invent one from the other.

Definition at line 41 of file Result.hpp.

Member Function Documentation

◆ Denied()

static Error VoltMod::Error::Denied ( std::string  key)
inlinestatic

key is a translation key: these two are the failures a player is told about.

Definition at line 54 of file Result.hpp.

References VoltMod::Denied, and VoltMod::ReadFile().

◆ Engine()

static Error VoltMod::Error::Engine ( std::string  detail)
inlinestatic

◆ Failed()

static Error VoltMod::Error::Failed ( std::string  detail)
inlinestatic

Definition at line 59 of file Result.hpp.

References VoltMod::Failed, and VoltMod::ReadFile().

Referenced by VoltMod::SharedLibrary::Open().

◆ Immune()

static Error VoltMod::Error::Immune ( std::string  key)
inlinestatic

Definition at line 55 of file Result.hpp.

References VoltMod::Immune, and VoltMod::ReadFile().

◆ Invalid()

◆ NotFound()

◆ NotReady()

◆ Unsupported()

Member Data Documentation

◆ Code

ErrorCode VoltMod::Error::Code = ErrorCode::Failed

Definition at line 43 of file Result.hpp.

Referenced by VoltMod::Caller::Fail().

◆ Detail

std::string VoltMod::Error::Detail

Definition at line 44 of file Result.hpp.

◆ Key

std::string VoltMod::Error::Key

Definition at line 45 of file Result.hpp.

◆ Text

std::string VoltMod::Error::Text

A line already localized for whoever ran the command; shown in place of Key.

Definition at line 47 of file Result.hpp.


The documentation for this struct was generated from the following file: