2026-07-10 07:08:42 +02:00
|
|
|
/// The URL doesn't point at a reachable, initialized Seerr instance.
|
2026-08-10 15:29:12 +02:00
|
|
|
///
|
|
|
|
|
/// [message] is English for stable logs and Sentry grouping. [display] is the
|
|
|
|
|
/// localized user-facing text when this failure is rendered in the UI.
|
2026-07-10 07:08:42 +02:00
|
|
|
class SeerrUrlException implements Exception {
|
|
|
|
|
final String message;
|
2026-08-10 15:29:12 +02:00
|
|
|
final String? display;
|
|
|
|
|
const SeerrUrlException(this.message, {this.display});
|
2026-07-10 07:08:42 +02:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String toString() => 'SeerrUrlException: $message';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Sign-in or session-refresh failure (bad credentials, revoked session).
|
|
|
|
|
/// [SeerrClient] treats this during re-auth as "the server rejected the
|
|
|
|
|
/// stored credentials" and unlinks the session.
|
2026-08-10 15:29:12 +02:00
|
|
|
///
|
|
|
|
|
/// [message] is English for stable logs and Sentry grouping. [display] is the
|
|
|
|
|
/// localized user-facing text when this failure is rendered in the UI.
|
2026-07-10 07:08:42 +02:00
|
|
|
class SeerrAuthException implements Exception {
|
|
|
|
|
final String message;
|
2026-08-10 15:29:12 +02:00
|
|
|
final String? display;
|
2026-07-10 07:08:42 +02:00
|
|
|
final int? statusCode;
|
2026-08-10 15:29:12 +02:00
|
|
|
const SeerrAuthException(this.message, {this.statusCode, this.display});
|
2026-07-10 07:08:42 +02:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String toString() => 'SeerrAuthException: $message${statusCode == null ? '' : ' ($statusCode)'}';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Silent re-auth could not even be ATTEMPTED — the credentials weren't
|
|
|
|
|
/// resolvable right now (e.g. the live Plex token supplier came up empty
|
|
|
|
|
/// during a degraded launch). Deliberately not a [SeerrAuthException]:
|
|
|
|
|
/// the failure is retryable and must not unlink the stored session.
|
2026-08-10 15:29:12 +02:00
|
|
|
///
|
|
|
|
|
/// [message] is English for stable logs and Sentry grouping. [display] is the
|
|
|
|
|
/// localized user-facing text when this failure is rendered in the UI.
|
2026-07-10 07:08:42 +02:00
|
|
|
class SeerrReauthUnavailableException implements Exception {
|
|
|
|
|
final String message;
|
2026-08-10 15:29:12 +02:00
|
|
|
final String? display;
|
|
|
|
|
const SeerrReauthUnavailableException(this.message, {this.display});
|
2026-07-10 07:08:42 +02:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String toString() => 'SeerrReauthUnavailableException: $message';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Non-auth API failure with a server-provided message (e.g. quota
|
|
|
|
|
/// exceeded on a request, duplicate request).
|
|
|
|
|
class SeerrApiException implements Exception {
|
|
|
|
|
final String message;
|
|
|
|
|
final int statusCode;
|
|
|
|
|
const SeerrApiException(this.message, {required this.statusCode});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String toString() => 'SeerrApiException($statusCode): $message';
|
|
|
|
|
}
|