You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
503 B
C++
24 lines
503 B
C++
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
// Copyright The Music Player Daemon Project
|
|
|
|
#pragma once
|
|
|
|
#include <stdexcept>
|
|
|
|
/**
|
|
* Thrown when an unsuccessful status was received from the HTTP
|
|
* server.
|
|
*/
|
|
class HttpStatusError : public std::runtime_error {
|
|
unsigned status;
|
|
|
|
public:
|
|
template<typename M>
|
|
explicit HttpStatusError(unsigned _status, M &&_msg) noexcept
|
|
:std::runtime_error(std::forward<M>(_msg)), status(_status) {}
|
|
|
|
unsigned GetStatus() const noexcept {
|
|
return status;
|
|
}
|
|
};
|