@mcma/core 0.13.29 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,13 +14,22 @@ class LogEvent {
|
|
|
14
14
|
}
|
|
15
15
|
flatten() {
|
|
16
16
|
var _a, _b, _c, _d, _e;
|
|
17
|
+
let message = this.message;
|
|
18
|
+
if (message instanceof Error) {
|
|
19
|
+
if (this.message.stack) {
|
|
20
|
+
message = this.message.stack;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
message = this.message.toString();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
17
26
|
const logEventEntry = {
|
|
18
27
|
type: this.type,
|
|
19
28
|
level: this.level,
|
|
20
29
|
source: this.source,
|
|
21
30
|
requestId: this.requestId,
|
|
22
31
|
timestamp: this.timestamp,
|
|
23
|
-
message
|
|
32
|
+
message,
|
|
24
33
|
trackerId: (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.id,
|
|
25
34
|
trackerLabel: (_b = this.tracker) === null || _b === void 0 ? void 0 : _b.label,
|
|
26
35
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare class McmaException extends Error {
|
|
2
2
|
message: string;
|
|
3
|
-
cause?:
|
|
3
|
+
cause?: Error;
|
|
4
4
|
context?: any;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
originalStack: string;
|
|
6
|
+
constructor(message: string, cause?: Error, context?: any);
|
|
7
|
+
toString(includeDetails?: boolean): string;
|
|
7
8
|
}
|
|
@@ -9,19 +9,24 @@ class McmaException extends Error {
|
|
|
9
9
|
this.context = context;
|
|
10
10
|
this.cause = cause;
|
|
11
11
|
this.context = context;
|
|
12
|
+
this.originalStack = this.stack;
|
|
13
|
+
this.stack = this.toString(true);
|
|
12
14
|
}
|
|
13
|
-
toString() {
|
|
15
|
+
toString(includeDetails = false) {
|
|
14
16
|
var _a;
|
|
15
17
|
let ret = "";
|
|
16
18
|
let c = this;
|
|
17
19
|
while (c) {
|
|
18
|
-
if (c.
|
|
20
|
+
if (includeDetails && c.originalStack) {
|
|
21
|
+
ret += c.originalStack;
|
|
22
|
+
}
|
|
23
|
+
else if (includeDetails && c.stack) {
|
|
19
24
|
ret += c.stack;
|
|
20
25
|
}
|
|
21
26
|
else {
|
|
22
27
|
ret += "Error: " + ((_a = c.message) !== null && _a !== void 0 ? _a : c);
|
|
23
28
|
}
|
|
24
|
-
if (c.context) {
|
|
29
|
+
if (includeDetails && c.context) {
|
|
25
30
|
ret += "\nContext:\n" + JSON.stringify(c.context, null, 2);
|
|
26
31
|
}
|
|
27
32
|
c = c.cause;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { McmaObject, McmaObjectProperties } from "./mcma-object";
|
|
2
2
|
export interface LocatorProperties extends McmaObjectProperties {
|
|
3
|
+
url: string;
|
|
3
4
|
}
|
|
4
5
|
export declare abstract class Locator extends McmaObject implements LocatorProperties {
|
|
6
|
+
url: string;
|
|
5
7
|
protected constructor(type: string, properties?: LocatorProperties);
|
|
6
8
|
}
|