Skip to content

Commit aa6df95

Browse files
committed
improve log
1 parent bb329b5 commit aa6df95

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/hono/src/node/middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const sentry = <E extends Env>(app: Hono<E>, options?: SentryHonoMiddlewa
2727
consoleSandbox(() => {
2828
// eslint-disable-next-line no-console
2929
console.warn(
30-
'[Sentry] Detected `Sentry.init` call from `@sentry/node` instead of `@sentry/hono/node`. Import from `@sentry/hono/node` to ensure Hono-specific instrumentation is applied correctly.',
30+
'[Sentry] Sentry was not initialized with `@sentry/hono/node`. Please import from `@sentry/hono/node` to ensure Hono-specific instrumentation is applied correctly.',
3131
);
3232
});
3333
} else {

packages/hono/test/node/middleware.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('Hono Node Middleware', () => {
104104
const app = new Hono();
105105
sentry(app);
106106

107-
expect(consoleWarnSpy).toHaveBeenCalledWith(expect.stringContaining('@sentry/hono/node'));
107+
expect(consoleWarnSpy).toHaveBeenCalledWith(expect.stringContaining('not initialized with `@sentry/hono/node`'));
108108
consoleWarnSpy.mockRestore();
109109
});
110110

@@ -116,7 +116,7 @@ describe('Hono Node Middleware', () => {
116116
const app = new Hono();
117117
sentry(app);
118118

119-
expect(consoleWarnSpy).toHaveBeenCalledWith(expect.stringContaining('@sentry/hono/node'));
119+
expect(consoleWarnSpy).toHaveBeenCalledWith(expect.stringContaining('not initialized with `@sentry/hono/node`'));
120120
consoleWarnSpy.mockRestore();
121121
});
122122
});

0 commit comments

Comments
 (0)