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
33 lines (27 loc) · 769 Bytes
/
ContextData.ts
File metadata and controls
33 lines (27 loc) · 769 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
export class ContextData {
public setException(exception:Error): void {
if (exception) {
this['@@_Exception'] = exception;
}
}
public get hasException(): boolean {
return !!this['@@_Exception']
}
public getException(): Error {
return this.hasException ? this['@@_Exception'] : null;
}
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 {
return !!this['@@_SubmissionMethod'] ? this['@@_SubmissionMethod'] : null;
}
}