Skip to content

Commit

Permalink
Deprecate non-exported exceptions and source / message ctor; introduce
Browse files Browse the repository at this point in the history
single argument ctor (#159)
  • Loading branch information
offa committed Feb 9, 2023
1 parent cf122dc commit 5df70f5
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions include/InfluxDBException.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,41 +39,40 @@ namespace influxdb
class INFLUXDB_EXPORT InfluxDBException : public std::runtime_error
{
public:
InfluxDBException(const std::string& source, const std::string& message)
/// \deprecated Use InfluxDBException(const std::string&) instead - will be removed in v0.8.0
[[deprecated("Use InfluxDBException(const std::string&) instead - will be removed in v0.8.0")]] InfluxDBException(const std::string& source, const std::string& message)
: std::runtime_error::runtime_error(
"influx-cxx [" + source + "]: " + message)
{
}
};

class NonExistentDatabase : public InfluxDBException
{
public:
NonExistentDatabase(const std::string& source, const std::string& message)
: InfluxDBException(source, message)
explicit InfluxDBException(const std::string& message)
: std::runtime_error::runtime_error(message)
{
}
};

class BadRequest : public InfluxDBException
{
public:
BadRequest(const std::string& source, const std::string& message)
: InfluxDBException(source, message)
{
}

/// \deprecated Use InfluxDBException instead - will be removed in v0.8.0
class [[deprecated("Use InfluxDBException instead - will be removed in v0.8.0")]] NonExistentDatabase : public InfluxDBException{
public :
NonExistentDatabase(const std::string& source, const std::string& message) : InfluxDBException(source, message){}
};

class ServerError : public InfluxDBException
{
public:
ServerError(const std::string& source, const std::string& message)
: InfluxDBException(source, message)
{
}
/// \deprecated Use InfluxDBException instead - will be removed in v0.8.0
class [[deprecated("Use InfluxDBException instead - will be removed in v0.8.0")]] BadRequest : public InfluxDBException{
public :
BadRequest(const std::string& source, const std::string& message) : InfluxDBException(source, message){}
};

/// \deprecated Use InfluxDBException instead - will be removed in v0.8.0
class [[deprecated("Use InfluxDBException instead - will be removed in v0.8.0")]] ServerError : public InfluxDBException{
public :
ServerError(const std::string& source, const std::string& message) : InfluxDBException(source, message){}
};

class ConnectionError : public InfluxDBException
/// \deprecated Use InfluxDBException instead - will be removed in v0.8.0
class [[deprecated("Use InfluxDBException instead - will be removed in v0.8.0")]] ConnectionError : public InfluxDBException
{
public:
ConnectionError(const std::string& source, const std::string& message)
Expand Down

0 comments on commit 5df70f5

Please sign in to comment.