Class SqlError

Synopsis

#include <orm_lib/inc/drogon/orm/Exception.h>

class SqlError : public Failure

Description

Exception class for failed queries.

Carries, in addition to a regular error message, a copy of the failed query and (if available) the SQLSTATE value accompanying the error.

Inheritance

Ancestors: Failure

Decsendents: InsufficientPrivilege, FeatureNotSupported, DataException, InvalidSqlStatementName, IntegrityConstraintViolation, InvalidCursorState, InvalidCursorName, SyntaxError, InsufficientResources

Methods

SqlError
~SqlError
queryThe query whose execution triggered the exception.
sqlState

Source

Lines 130-146 in orm_lib/inc/drogon/orm/Exception.h. Line 131 in orm_lib/inc/drogon/orm/Exception.h.

class SqlError : public Failure
{
    /// Query string.  Empty if unknown.
    const std::string query_;
    /// SQLSTATE string describing the error type, if known; or empty string.
    const std::string sqlState_;

  public:
    explicit SqlError(const std::string &msg = "",
                      const std::string &Q = "",
                      const char sqlstate[] = nullptr);
    virtual ~SqlError() noexcept;

    /// The query whose execution triggered the exception
    const std::string &query() const noexcept;
    const std::string &sqlState() const noexcept;
};





Add Discussion as Guest

Log in to DocsForge