mirror of
https://github.com/kirirururu/telebotxx.git
synced 2026-06-14 18:30:43 +00:00
36 lines
535 B
C++
36 lines
535 B
C++
#ifndef TELEBOTXX_EXCEPTION_HPP
|
|
#define TELEBOTXX_EXCEPTION_HPP
|
|
|
|
#include <stdexcept>
|
|
|
|
namespace telebotxx
|
|
{
|
|
class ParseError : public std::invalid_argument
|
|
{
|
|
public:
|
|
ParseError(const std::string& message)
|
|
: std::invalid_argument(message)
|
|
{
|
|
}
|
|
};
|
|
|
|
class ApiError : public std::runtime_error
|
|
{
|
|
public:
|
|
ApiError(int code, const std::string& message)
|
|
: std::runtime_error(message), code_(code)
|
|
{
|
|
}
|
|
|
|
int getCode() const
|
|
{
|
|
return code_;
|
|
}
|
|
|
|
protected:
|
|
int code_;
|
|
};
|
|
|
|
}
|
|
|
|
#endif // TELEBOTXX_EXCEPTION_HPP
|