|
6 | 6 | // When handling is required, it is best to use custom error types with both standard and custom traits. |
7 | 7 | CommonErrors = NewNamespace("common") |
8 | 8 |
|
| 9 | + // IllegalArgument is a type for invalid argument error |
9 | 10 | IllegalArgument = CommonErrors.NewType("illegal_argument") |
| 11 | + // IllegalState is a type for invalid state error |
10 | 12 | IllegalState = CommonErrors.NewType("illegal_state") |
| 13 | + // IllegalFormat is a type for invalid format error |
11 | 14 | IllegalFormat = CommonErrors.NewType("illegal_format") |
| 15 | + // InitializationFailed is a type for initialization error |
12 | 16 | InitializationFailed = CommonErrors.NewType("initialization_failed") |
| 17 | + // DataUnavailable is a type for unavailable data error |
13 | 18 | DataUnavailable = CommonErrors.NewType("data_unavailable") |
| 19 | + // UnsupportedOperation is a type for unsupported operation error |
14 | 20 | UnsupportedOperation = CommonErrors.NewType("unsupported_operation") |
| 21 | + // RejectedOperation is a type for rejected operation error |
15 | 22 | RejectedOperation = CommonErrors.NewType("rejected_operation") |
| 23 | + // Interrupted is a type for interruption error |
16 | 24 | Interrupted = CommonErrors.NewType("interrupted") |
| 25 | + // AssertionFailed is a type for assertion error |
17 | 26 | AssertionFailed = CommonErrors.NewType("assertion_failed") |
| 27 | + // InternalError is a type for internal error |
18 | 28 | InternalError = CommonErrors.NewType("internal_error") |
| 29 | + // ExternalError is a type for external error |
19 | 30 | ExternalError = CommonErrors.NewType("external_error") |
| 31 | + // ConcurrentUpdate is a type for concurrent update error |
20 | 32 | ConcurrentUpdate = CommonErrors.NewType("concurrent_update") |
| 33 | + // TimeoutElapsed is a type for timeout error |
21 | 34 | TimeoutElapsed = CommonErrors.NewType("timeout", Timeout()) |
| 35 | + // NotImplemented is an error type for lacking implementation |
22 | 36 | NotImplemented = UnsupportedOperation.NewSubtype("not_implemented") |
| 37 | + // UnsupportedVersion is a type for unsupported type error |
23 | 38 | UnsupportedVersion = UnsupportedOperation.NewSubtype("version") |
24 | 39 | ) |
0 commit comments