input/tidal/Error: add method IsInvalidSession()

This commit is contained in:
Max Kellermann 2018-01-24 14:02:50 +01:00
parent 4398101706
commit e8e6357b73
1 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,9 @@
/**
* An error condition reported by the server.
*
* See http://developer.tidal.com/technical/errors/ for details (login
* required).
*/
class TidalError : public std::runtime_error {
/**
@ -52,6 +55,10 @@ public:
unsigned GetSubStatus() const noexcept {
return sub_status;
}
bool IsInvalidSession() const noexcept {
return sub_status == 6001 || sub_status == 6002;
}
};
#endif