File tree Expand file tree Collapse file tree 2 files changed +3
-15
lines changed
Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,14 @@ export function authorizeWithAnyOf(...authzMethods: AuthzMethod[]) {
1515 return next ( )
1616 }
1717 }
18+ const message = `This request cannot be authorized`
1819 throw new HTTPException ( 401 , {
19- message : `This request cannot be authorized` ,
20+ message,
21+ res : c . json ( { message } , 401 )
2022 } )
2123 }
2224}
2325
24-
2526export function authorizeWithSpace ( options : {
2627 space : ( c : Context ) => Promise < ISpace > ,
2728 data : Database ,
Original file line number Diff line number Diff line change @@ -76,19 +76,6 @@ export class ServerHono extends Hono {
7676 data,
7777 space : ( c ) => c . req . param ( 'space' ) ,
7878 } ) )
79-
80- hono . onError ( async ( err , c ) => {
81- if ( err instanceof HTTPException ) {
82- return c . json ( {
83- message : err . message ,
84- status : err . status ,
85- } , err . status )
86- }
87- return c . json ( {
88- status : 500 ,
89- message : `Unexpected error` ,
90- } , 500 )
91- } )
9279 }
9380}
9481
You can’t perform that action at this time.
0 commit comments