Skip to content

Commit e910c66

Browse files
committed
review comments
1 parent 05fdea1 commit e910c66

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

packages/cloudflare/src/integrations/hono.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@ export interface Options {
1818

1919
/** Only exported for internal use */
2020
export function getHonoIntegration(): ReturnType<typeof _honoIntegration> | undefined {
21-
const client = getClient();
22-
if (!client) {
23-
return undefined;
24-
} else {
25-
return client.getIntegrationByName(INTEGRATION_NAME);
26-
}
21+
return getClient()?.getIntegrationByName(INTEGRATION_NAME);
2722
}
2823

2924
function isHonoError(err: unknown): err is HonoError {
@@ -36,7 +31,6 @@ function isHonoError(err: unknown): err is HonoError {
3631
const _honoIntegration = ((options: Partial<Options> = {}) => {
3732
return {
3833
name: INTEGRATION_NAME,
39-
setupOnce() {},
4034
handleHonoException(err: HonoError): void {
4135
const shouldHandleError = options.shouldHandleError || defaultShouldHandleError;
4236

@@ -46,7 +40,7 @@ const _honoIntegration = ((options: Partial<Options> = {}) => {
4640
}
4741

4842
if (shouldHandleError(err)) {
49-
captureException(err, { mechanism: { handled: false, type: 'auto.faas.cloudflare.error_handler' } });
43+
captureException(err, { mechanism: { handled: false, type: 'auto.faas.hono.error_handler' } });
5044
} else {
5145
DEBUG_BUILD && debug.log('[Hono] Not capturing exception because `shouldHandleError` returned `false`.', err);
5246
}

packages/cloudflare/test/integrations/hono.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('Hono integration', () => {
3838

3939
expect(captureExceptionSpy).toHaveBeenCalledTimes(1);
4040
expect(captureExceptionSpy).toHaveBeenLastCalledWith(error, {
41-
mechanism: { handled: false, type: 'auto.faas.cloudflare.error_handler' },
41+
mechanism: { handled: false, type: 'auto.faas.hono.error_handler' },
4242
});
4343
});
4444

0 commit comments

Comments
 (0)