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 {
1818
1919/** Only exported for internal use */
2020export 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
2924function isHonoError ( err : unknown ) : err is HonoError {
@@ -36,7 +31,6 @@ function isHonoError(err: unknown): err is HonoError {
3631const _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 }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments