|
5 | 5 | // SPDX-License-Identifier: Apache-2.0
|
6 | 6 | //
|
7 | 7 |
|
| 8 | +/// Errors thrown by implementations of the |
| 9 | +/// [StorageCategoryPlugin](x-source-tag://StorageCategoryPlugin) protocol. |
| 10 | +/// |
| 11 | +/// - Tag: StorageError |
8 | 12 | public enum StorageError {
|
| 13 | + |
| 14 | + /// Surfaced when a storage operation is attempted for either a file or a key to which the current user |
| 15 | + /// does not have access. |
| 16 | + /// |
| 17 | + /// - Tag: StorageError.accessDenied |
9 | 18 | case accessDenied(ErrorDescription, RecoverySuggestion, Error? = nil)
|
| 19 | + |
| 20 | + /// Surfaced when a storage operation is unable to resolve the current user. |
| 21 | + /// |
| 22 | + /// - Tag: StorageError.authError |
10 | 23 | case authError(ErrorDescription, RecoverySuggestion, Error? = nil)
|
| 24 | + |
| 25 | + /// Surfaced when a storage plugin encounters an error during its configuration. |
| 26 | + /// |
| 27 | + /// - Tag: StorageError.configuration |
11 | 28 | case configuration(ErrorDescription, RecoverySuggestion, Error? = nil)
|
| 29 | + |
| 30 | + /// Surfaced when a storage operation encounters an HTTP status code it considers an error. |
| 31 | + /// |
| 32 | + /// - Tag: StorageError.httpStatusError |
12 | 33 | case httpStatusError(Int, RecoverySuggestion, Error? = nil)
|
| 34 | + |
| 35 | + /// Surfaced when a storage operation encounters an HTTP status code it considers an error. |
| 36 | + /// |
| 37 | + /// - Tag: StorageError.keyNotFound |
13 | 38 | case keyNotFound(Key, ErrorDescription, RecoverySuggestion, Error? = nil)
|
| 39 | + |
| 40 | + /// Surfaced when a storage operation is unable to find a local file, usually when attempting to upload. |
| 41 | + /// |
| 42 | + /// - Tag: StorageError.localFileNotFound |
14 | 43 | case localFileNotFound(ErrorDescription, RecoverySuggestion, Error? = nil)
|
| 44 | + |
| 45 | + /// Surfaced when a storage operation encounters an unexpected server-side error. |
| 46 | + /// |
| 47 | + /// - Tag: StorageError.service |
15 | 48 | case service(ErrorDescription, RecoverySuggestion, Error? = nil)
|
| 49 | + |
| 50 | + /// Surfaced when a storage operation encounters an general unexpected error. |
| 51 | + /// |
| 52 | + /// - Tag: StorageError.unknown |
16 | 53 | case unknown(ErrorDescription, Error? = nil)
|
| 54 | + |
| 55 | + /// Surfaced when a storage operation encounters invalid input. |
| 56 | + /// |
| 57 | + /// - Tag: StorageError.validation |
17 | 58 | case validation(Field, ErrorDescription, RecoverySuggestion, Error? = nil)
|
18 | 59 | }
|
19 | 60 |
|
|
0 commit comments