forked from exceptionless/Exceptionless.JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContextData.ts
More file actions
41 lines (33 loc) · 826 Bytes
/
ContextData.ts
File metadata and controls
41 lines (33 loc) · 826 Bytes
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
export class ContextData {
public setException(exception:Error): void {
if (exception) {
this['@@_Exception'] = exception;
}
}
public get hasException(): boolean {
return !!this['@@_Exception']
}
public getException(): Error {
if (!this.hasException) {
return null;
}
return this['@@_Exception'];
}
public markAsUnhandledError(): void {
this['@@_IsUnhandledError'] = true;
}
public get isUnhandledError(): boolean {
return !!this['@@_IsUnhandledError'];
}
public setSubmissionMethod(method:string): void {
if (method && method.length > 0) {
this['@@_SubmissionMethod'] = method;
}
}
public getSubmissionMethod(): string {
if (!!this['@@_SubmissionMethod']) {
return null;
}
return this['@@_SubmissionMethod'];
}
}