mirror of
https://github.com/allankoechke/SQLiteCpp.git
synced 2026-12-01 09:08:47 +00:00
- Using SQLite::Exception instead of std::runtime_error - Adding exception spec everywhere - Simplifing the Database constructor parameters to simply use "flags"
35 lines
841 B
C++
35 lines
841 B
C++
/**
|
|
* @file Exception.h
|
|
* @brief Encapsulation of the error message from SQLite3 on a std::runtime_error.
|
|
*
|
|
* Copyright (c) 2012 Sebastien Rombauts (sebastien dot rombauts at gmail dot com)
|
|
*
|
|
* Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
|
|
* or copy at http://opensource.org/licenses/MIT)
|
|
*/
|
|
#pragma once
|
|
|
|
#include <stdexcept>
|
|
|
|
#ifdef _WIN32
|
|
#pragma warning(disable:4290) // Disable warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
|
|
#endif
|
|
|
|
namespace SQLite
|
|
{
|
|
|
|
/**
|
|
* @brief Encapsulation of the error message from SQLite3, based on std::runtime_error.
|
|
*/
|
|
class Exception : public std::runtime_error
|
|
{
|
|
public:
|
|
Exception(const std::string& aErrorMessage) :
|
|
std::runtime_error(aErrorMessage)
|
|
{
|
|
}
|
|
};
|
|
|
|
|
|
}; // namespace SQLite
|