File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,7 @@ export interface Options {
18
18
19
19
/** Only exported for internal use */
20
20
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 ) ;
27
22
}
28
23
29
24
function isHonoError ( err : unknown ) : err is HonoError {
@@ -36,7 +31,6 @@ function isHonoError(err: unknown): err is HonoError {
36
31
const _honoIntegration = ( ( options : Partial < Options > = { } ) => {
37
32
return {
38
33
name : INTEGRATION_NAME ,
39
- setupOnce ( ) { } ,
40
34
handleHonoException ( err : HonoError ) : void {
41
35
const shouldHandleError = options . shouldHandleError || defaultShouldHandleError ;
42
36
@@ -46,7 +40,7 @@ const _honoIntegration = ((options: Partial<Options> = {}) => {
46
40
}
47
41
48
42
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' } } ) ;
50
44
} else {
51
45
DEBUG_BUILD && debug . log ( '[Hono] Not capturing exception because `shouldHandleError` returned `false`.' , err ) ;
52
46
}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ describe('Hono integration', () => {
38
38
39
39
expect ( captureExceptionSpy ) . toHaveBeenCalledTimes ( 1 ) ;
40
40
expect ( captureExceptionSpy ) . toHaveBeenLastCalledWith ( error , {
41
- mechanism : { handled : false , type : 'auto.faas.cloudflare .error_handler' } ,
41
+ mechanism : { handled : false , type : 'auto.faas.hono .error_handler' } ,
42
42
} ) ;
43
43
} ) ;
44
44
You can’t perform that action at this time.
0 commit comments