mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-08 00:07:48 -06:00
56 lines
1.3 KiB
Dart
56 lines
1.3 KiB
Dart
class ErrorMessage implements Exception {
|
|
final ErrorCode code;
|
|
final String? details;
|
|
final StackTrace? stackTrace;
|
|
final int? httpStatusCode;
|
|
|
|
const ErrorMessage(
|
|
this.code, {
|
|
this.details,
|
|
this.stackTrace,
|
|
this.httpStatusCode,
|
|
});
|
|
|
|
const ErrorMessage.unknown() : this(ErrorCode.unknown);
|
|
|
|
@override
|
|
String toString() {
|
|
return "ErrorMessage(code: $code${stackTrace != null ? ', stackTrace: ${stackTrace.toString()}' : ''}${httpStatusCode != null ? ', httpStatusCode: $httpStatusCode' : ''})";
|
|
}
|
|
}
|
|
|
|
enum ErrorCode {
|
|
unknown,
|
|
authenticationFailed,
|
|
notAuthenticated,
|
|
documentUploadFailed,
|
|
documentUpdateFailed,
|
|
documentLoadFailed,
|
|
documentDeleteFailed,
|
|
documentBulkActionFailed,
|
|
documentPreviewFailed,
|
|
documentAsnQueryFailed,
|
|
tagCreateFailed,
|
|
tagLoadFailed,
|
|
documentTypeCreateFailed,
|
|
documentTypeLoadFailed,
|
|
correspondentCreateFailed,
|
|
correspondentLoadFailed,
|
|
scanRemoveFailed,
|
|
invalidClientCertificateConfiguration,
|
|
biometricsNotSupported,
|
|
biometricAuthenticationFailed,
|
|
deviceOffline,
|
|
serverUnreachable,
|
|
similarQueryError,
|
|
autocompleteQueryError,
|
|
storagePathLoadFailed,
|
|
storagePathCreateFailed,
|
|
loadSavedViewsError,
|
|
createSavedViewError,
|
|
deleteSavedViewError,
|
|
requestTimedOut,
|
|
unsupportedFileFormat,
|
|
missingClientCertificate;
|
|
}
|