Skip to content

Commit 7bba630

Browse files
committed
add test
1 parent 08e22c9 commit 7bba630

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

packages/node/src/client.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ export class NodeClient extends BaseClient<NodeClientOptions> {
118118
*/
119119
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
120120
public eventFromException(exception: any, hint?: EventHint): PromiseLike<Event> {
121-
return resolvedSyncPromise(
122-
eventFromUnknownInput(this._options.stackParser, exception, hint, this._options.normalizeDepth),
123-
);
121+
return resolvedSyncPromise(eventFromUnknownInput(this._options.stackParser, exception, hint));
124122
}
125123

126124
/**

packages/node/src/eventbuilder.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,7 @@ export function exceptionFromError(stackParser: StackParser, error: Error): Exce
4646
* Builds and Event from a Exception
4747
* @hidden
4848
*/
49-
export function eventFromUnknownInput(
50-
stackParser: StackParser,
51-
exception: unknown,
52-
hint?: EventHint,
53-
normalizeDepth?: number,
54-
): Event {
49+
export function eventFromUnknownInput(stackParser: StackParser, exception: unknown, hint?: EventHint): Event {
5550
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5651
let ex: unknown = exception;
5752
const providedMechanism: Mechanism | undefined =
@@ -67,7 +62,10 @@ export function eventFromUnknownInput(
6762
// which is much better than creating new group when any key/value change
6863
const message = `Non-Error exception captured with keys: ${extractExceptionKeysForMessage(exception)}`;
6964

70-
getCurrentHub().configureScope(scope => {
65+
const hub = getCurrentHub();
66+
const client = hub.getClient();
67+
const normalizeDepth = client && client.getOptions().normalizeDepth;
68+
hub.configureScope(scope => {
7169
scope.setExtra('__serialized__', normalizeToSize(exception, normalizeDepth));
7270
});
7371

0 commit comments

Comments
 (0)