Files
poco/Data/PostgreSQL/src/PostgreSQLException.cpp
Kari Argillander bf3c519183 Fix some issues found with clang-tidy (#4353)
* directoryiterator: Fix missing inline

Add missing inline to inline function.

This was found with clang-tidy check:  misc-definitions-in-headers

* Convert deprecated throw() to noexcept

throw() has been deprecated in standar in C++17. It has been removed in
C++20. Code still compiles but let's just define these at those should
be.

These where found with clang-tidy check: modernize-use-noexcept

* Fix unnecessary copy initializations

Clang-tidy did find these with check:

  performance-unnecessary-copy-initialization

* Fix some strings not references

Looks like these are just missing reference marks.

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
2023-12-17 16:55:30 +01:00

93 lines
1.6 KiB
C++

//
// PostgreSQLException.cpp
//
// Library: Data/PostgreSQL
// Package: PostgreSQL
// Module: PostgreSQLException
//
// Copyright (c) 2015, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Data/PostgreSQL/PostgreSQLException.h"
#include <cstring>
namespace Poco {
namespace Data {
namespace PostgreSQL {
PostgreSQLException::PostgreSQLException(const std::string& aMessage):
Poco::Data::DataException(std::string("[PostgreSQL]: ") + aMessage)
{
}
PostgreSQLException::PostgreSQLException(const std::string& aMessage,const char* pAnSqlState):
Poco::Data::DataException(std::string("[PostgreSQL]: ") + aMessage)
{
// handle anSqlState
if (pAnSqlState == nullptr) _sqlState[0] = '\0';
else
{
strncpy(_sqlState,pAnSqlState,5);
_sqlState[5] = '\0';
}
}
PostgreSQLException::PostgreSQLException(const PostgreSQLException& anException):
Poco::Data::DataException(anException)
{
}
PostgreSQLException::~PostgreSQLException() noexcept
{
}
//
// ConnectionException
//
ConnectionException::ConnectionException(const std::string& aMessage):
PostgreSQLException(aMessage)
{
}
//
// TransactionException
//
TransactionException::TransactionException(const std::string& aMessage):
ConnectionException(aMessage)
{
}
//
// StatementException
//
StatementException::StatementException(const std::string& aMessage):
PostgreSQLException(aMessage)
{
}
StatementException::StatementException(const std::string& aMessage,const char* pAnSqlState):
PostgreSQLException(aMessage,pAnSqlState)
{
}
} } } // namespace Poco::Data::PostgreSQL