4#ifndef WATERLINKEDSONAR_HTTP_ERRORS_HPP
5#define WATERLINKEDSONAR_HTTP_ERRORS_HPP
10namespace waterlinked::sonar {
18 : std::runtime_error(what), status_code_(
status_code) {}
21 [[nodiscard]]
int status_code() const noexcept {
return status_code_; }
33 VersionError(
const std::string& what,
const std::string& min_version,
34 const std::string& device_version)
35 : std::runtime_error(what +
" requires Sonar 3D-15 release " +
36 min_version +
" or newer; device is " +
44 explicit ProtocolError(
const std::string& what) : std::runtime_error(what) {}
53 :
HttpError(
"system time is already synchronized", 409) {}
SonarClient::force_sync_ntp() was called while another force-sync is running (HTTP 409).
Definition errors.hpp:58
ForceSyncOngoingError()
Sets status_code() to 409.
Definition errors.hpp:61
Request failure or non-2xx HTTP response.
Definition errors.hpp:13
HttpError(const std::string &what, int status_code)
Definition errors.hpp:17
int status_code() const noexcept
HTTP status of the response, or 0 when no response arrived.
Definition errors.hpp:21
The device answered with a body that does not match the API.
Definition errors.hpp:41
ProtocolError(const std::string &what)
Definition errors.hpp:44
SonarClient::set_time_manual() was called while the device clock is NTP-synchronized (HTTP 409).
Definition errors.hpp:49
TimeAlreadySynchronizedError()
Sets status_code() to 409.
Definition errors.hpp:52
The device firmware is older than the operation requires.
Definition errors.hpp:28
VersionError(const std::string &what, const std::string &min_version, const std::string &device_version)
Definition errors.hpp:33