-
Notifications
You must be signed in to change notification settings - Fork 10
/
EncodingErrorDefinition.ts
57 lines (49 loc) · 1.3 KB
/
EncodingErrorDefinition.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
import {map, mapArray} from '../common/Mapper';
import ErrorRetryHint from './ErrorRetryHint';
/**
* @export
* @class EncodingErrorDefinition
*/
export class EncodingErrorDefinition {
/**
* The error code.
* @type {number}
* @memberof EncodingErrorDefinition
*/
public code?: number;
/**
* The error category.
* @type {string}
* @memberof EncodingErrorDefinition
*/
public category?: string;
/**
* The error message, optional. Can include placeholders like {1}, {2} which are replaced with the respective dependency when the error is thrown.
* @type {string}
* @memberof EncodingErrorDefinition
*/
public message?: string;
/**
* The returned error description.
* @type {string}
* @memberof EncodingErrorDefinition
*/
public description?: string;
/**
* Indicates if the call that caused the error should be retried.
* @type {ErrorRetryHint}
* @memberof EncodingErrorDefinition
*/
public retryHint?: ErrorRetryHint;
constructor(obj?: Partial<EncodingErrorDefinition>) {
if(!obj) {
return;
}
this.code = map(obj.code);
this.category = map(obj.category);
this.message = map(obj.message);
this.description = map(obj.description);
this.retryHint = map(obj.retryHint);
}
}
export default EncodingErrorDefinition;