2023-05-20 13:49:27 +02:00
|
|
|
import 'package:np_api/np_api.dart' as api;
|
2021-04-10 06:28:12 +02:00
|
|
|
|
|
|
|
class CacheNotFoundException implements Exception {
|
2023-04-13 17:32:31 +02:00
|
|
|
const CacheNotFoundException([this.message]);
|
2021-04-10 06:28:12 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
toString() {
|
|
|
|
if (message == null) {
|
|
|
|
return "CacheNotFoundException";
|
|
|
|
} else {
|
|
|
|
return "CacheNotFoundException: $message";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
final dynamic message;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ApiException implements Exception {
|
2021-07-23 22:05:57 +02:00
|
|
|
ApiException({
|
|
|
|
required this.response,
|
|
|
|
this.message,
|
|
|
|
});
|
2021-04-10 06:28:12 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
toString() {
|
|
|
|
if (message == null) {
|
|
|
|
return "ApiException";
|
|
|
|
} else {
|
|
|
|
return "ApiException: $message";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-20 13:49:27 +02:00
|
|
|
final api.Response response;
|
2021-04-10 06:28:12 +02:00
|
|
|
final dynamic message;
|
|
|
|
}
|
|
|
|
|
2021-05-06 06:57:20 +02:00
|
|
|
/// The Nextcloud base URL address is invalid
|
|
|
|
class InvalidBaseUrlException implements Exception {
|
|
|
|
InvalidBaseUrlException([this.message]);
|
|
|
|
|
|
|
|
@override
|
|
|
|
toString() {
|
|
|
|
if (message == null) {
|
|
|
|
return "InvalidBaseUrlException";
|
|
|
|
} else {
|
|
|
|
return "InvalidBaseUrlException: $message";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
final dynamic message;
|
|
|
|
}
|
2021-09-19 12:59:45 +02:00
|
|
|
|
|
|
|
/// A download job has failed
|
|
|
|
class DownloadException implements Exception {
|
|
|
|
DownloadException([this.message]);
|
|
|
|
|
|
|
|
@override
|
|
|
|
toString() {
|
|
|
|
return "DownloadException: $message";
|
|
|
|
}
|
|
|
|
|
|
|
|
final dynamic message;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// A running job has been canceled
|
|
|
|
class JobCanceledException implements Exception {
|
|
|
|
JobCanceledException([this.message]);
|
|
|
|
|
|
|
|
@override
|
|
|
|
toString() {
|
|
|
|
return "JobCanceledException: $message";
|
|
|
|
}
|
|
|
|
|
|
|
|
final dynamic message;
|
|
|
|
}
|
2021-11-18 11:50:51 +01:00
|
|
|
|
|
|
|
/// Trying to downgrade an Album
|
|
|
|
class AlbumDowngradeException implements Exception {
|
|
|
|
const AlbumDowngradeException([this.message]);
|
|
|
|
|
|
|
|
@override
|
|
|
|
toString() {
|
|
|
|
return "AlbumDowngradeException: $message";
|
|
|
|
}
|
|
|
|
|
|
|
|
final dynamic message;
|
|
|
|
}
|
2022-04-08 22:16:35 +02:00
|
|
|
|
|
|
|
class InterruptedException implements Exception {
|
|
|
|
const InterruptedException([this.message]);
|
|
|
|
|
|
|
|
@override
|
|
|
|
toString() => "InterruptedException: $message";
|
|
|
|
|
|
|
|
final dynamic message;
|
|
|
|
}
|
2023-04-13 17:32:31 +02:00
|
|
|
|
|
|
|
class AlbumItemPermissionException implements Exception {
|
|
|
|
const AlbumItemPermissionException([this.message]);
|
|
|
|
|
|
|
|
@override
|
|
|
|
toString() => "AlbumItemPermissionException: $message";
|
|
|
|
|
|
|
|
final dynamic message;
|
|
|
|
}
|
2023-05-01 19:05:33 +02:00
|
|
|
|
|
|
|
class CollectionPartialShareException implements Exception {
|
2023-05-20 13:49:27 +02:00
|
|
|
const CollectionPartialShareException(this.shareeName, [this.message]);
|
2023-05-01 19:05:33 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
|
|
|
if (message == null) {
|
|
|
|
return "CollectionPartialShareException";
|
|
|
|
} else {
|
|
|
|
return "CollectionPartialShareException: $message";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-20 13:49:27 +02:00
|
|
|
final String shareeName;
|
|
|
|
final dynamic message;
|
|
|
|
}
|
|
|
|
|
|
|
|
class CollectionPartialUnshareException implements Exception {
|
|
|
|
const CollectionPartialUnshareException(this.shareeName, [this.message]);
|
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
|
|
|
if (message == null) {
|
|
|
|
return "CollectionPartialUnshareException";
|
|
|
|
} else {
|
|
|
|
return "CollectionPartialUnshareException: $message";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
final String shareeName;
|
2023-05-01 19:05:33 +02:00
|
|
|
final dynamic message;
|
|
|
|
}
|