Skip to content

Commit 5df70f5

Browse files
committed
Deprecate non-exported exceptions and source / message ctor; introduce
single argument ctor (#159)
1 parent cf122dc commit 5df70f5

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

include/InfluxDBException.h

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,41 +39,40 @@ namespace influxdb
3939
class INFLUXDB_EXPORT InfluxDBException : public std::runtime_error
4040
{
4141
public:
42-
InfluxDBException(const std::string& source, const std::string& message)
42+
/// \deprecated Use InfluxDBException(const std::string&) instead - will be removed in v0.8.0
43+
[[deprecated("Use InfluxDBException(const std::string&) instead - will be removed in v0.8.0")]] InfluxDBException(const std::string& source, const std::string& message)
4344
: std::runtime_error::runtime_error(
4445
"influx-cxx [" + source + "]: " + message)
4546
{
4647
}
47-
};
4848

49-
class NonExistentDatabase : public InfluxDBException
50-
{
51-
public:
52-
NonExistentDatabase(const std::string& source, const std::string& message)
53-
: InfluxDBException(source, message)
49+
explicit InfluxDBException(const std::string& message)
50+
: std::runtime_error::runtime_error(message)
5451
{
5552
}
5653
};
5754

58-
class BadRequest : public InfluxDBException
59-
{
60-
public:
61-
BadRequest(const std::string& source, const std::string& message)
62-
: InfluxDBException(source, message)
63-
{
64-
}
55+
56+
/// \deprecated Use InfluxDBException instead - will be removed in v0.8.0
57+
class [[deprecated("Use InfluxDBException instead - will be removed in v0.8.0")]] NonExistentDatabase : public InfluxDBException{
58+
public :
59+
NonExistentDatabase(const std::string& source, const std::string& message) : InfluxDBException(source, message){}
6560
};
6661

67-
class ServerError : public InfluxDBException
68-
{
69-
public:
70-
ServerError(const std::string& source, const std::string& message)
71-
: InfluxDBException(source, message)
72-
{
73-
}
62+
/// \deprecated Use InfluxDBException instead - will be removed in v0.8.0
63+
class [[deprecated("Use InfluxDBException instead - will be removed in v0.8.0")]] BadRequest : public InfluxDBException{
64+
public :
65+
BadRequest(const std::string& source, const std::string& message) : InfluxDBException(source, message){}
66+
};
67+
68+
/// \deprecated Use InfluxDBException instead - will be removed in v0.8.0
69+
class [[deprecated("Use InfluxDBException instead - will be removed in v0.8.0")]] ServerError : public InfluxDBException{
70+
public :
71+
ServerError(const std::string& source, const std::string& message) : InfluxDBException(source, message){}
7472
};
7573

76-
class ConnectionError : public InfluxDBException
74+
/// \deprecated Use InfluxDBException instead - will be removed in v0.8.0
75+
class [[deprecated("Use InfluxDBException instead - will be removed in v0.8.0")]] ConnectionError : public InfluxDBException
7776
{
7877
public:
7978
ConnectionError(const std::string& source, const std::string& message)

0 commit comments

Comments
 (0)