Class AMSError

Class Documentation

class AMSError

Strongly-typed error object used across AMS.

AMSError carries a message, a typed category, and optional file/line information. File/line are stored separately from the message to allow hiding implementation details in certain build modes.

Public Functions

inline AMSError(AMSErrorType Type, std::string Message, std::string File = std::string{}, int Line = 0)

Construct an error with type, message, and optional file/line.

Parameters:
  • type – The error category.

  • message – Human-readable description of the error.

  • file – Source file where the error originated (optional).

  • line – Source line where the error originated (optional).

AMSError(const AMSError&) = default

Defaulted copy constructor.

AMSError(AMSError&&) noexcept = default

Defaulted move constructor.

AMSError &operator=(const AMSError&) = default

Defaulted copy assignment.

AMSError &operator=(AMSError&&) noexcept = default

Defaulted move assignment.

inline const std::string &getMessage() const

Return the error message.

inline AMSErrorType getType() const

Return the error type.

inline const std::string &getFile() const

Return the source file where the error was created (may be empty).

inline int getLine() const

Return the source line where the error was created (may be zero).