-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexception.ts
61 lines (55 loc) · 1.14 KB
/
exception.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* @file Data Transfer Objects - ExceptionDTO
* @module exceptions/dtos/ExceptionDTO
*/
import type * as aggregate from '@flex-development/aggregate-error-ponyfill'
import type {
JsonValue,
Jsonifiable,
JsonifiableObject,
Nilable,
Nullable,
ObjectPlain,
ObjectUnknown,
OneOrMany
} from '@flex-development/tutils'
/**
* `Exception` data transfer object.
*
* @template T - Aggregated error type
* @template Cause - Exception cause type
* @template Code - Exception code type
*
* @extends {aggregate.Options<Cause>}
*/
interface ExceptionDTO<
T extends ObjectPlain = JsonifiableObject,
Cause extends ObjectPlain = JsonifiableObject,
Code extends Nullable<number | string> = string
> extends aggregate.Options<Cause> {
[key: string]:
| Jsonifiable
| JsonValue
| ObjectUnknown
| OneOrMany<T>
| undefined
/**
* Exception code.
*
* @default null
*/
code?: Nilable<Code>
/**
* Aggregated errors.
*
* @default []
*/
errors?: OneOrMany<T> | undefined
/**
* Exception stack trace.
*
* @default ''
*/
stack?: string | undefined
}
export type { ExceptionDTO as default }