@@ -1196,24 +1196,26 @@ export type ComposeElysiaResponse<Response, Handle> = Handle extends (
11961196 : _ComposeElysiaResponse < Response , Replace < Awaited < Handle > , BunFile , File > >
11971197
11981198type _ComposeElysiaResponse < Response , Handle > = Prettify <
1199- { } extends Response
1200- ? {
1201- 200 : Exclude < Handle , ElysiaCustomStatusResponse < any , any , any > >
1202- } & {
1203- [ ErrorResponse in Extract <
1204- Handle ,
1205- ElysiaCustomStatusResponse < any , any , any >
1206- > as ErrorResponse extends ElysiaCustomStatusResponse <
1207- any ,
1208- any ,
1209- any
1210- >
1211- ? ErrorResponse [ 'code' ]
1212- : never ] : ErrorResponse [ 'response' ]
1213- }
1214- : Response
1199+ Prettify <
1200+ {
1201+ 200 : Exclude <
1202+ Handle ,
1203+ ElysiaCustomStatusResponse < any , any , any >
1204+ >
1205+ } & ExtractErrorFromHandle < Handle > &
1206+ ( { } extends Response ? { } : Omit < Response , 200 > )
1207+ >
12151208>
12161209
1210+ type ExtractErrorFromHandle < Handle > = {
1211+ [ ErrorResponse in Extract <
1212+ Handle ,
1213+ ElysiaCustomStatusResponse < any , any , any >
1214+ > as ErrorResponse extends ElysiaCustomStatusResponse < any , any , any >
1215+ ? ErrorResponse [ 'code' ]
1216+ : never ] : ErrorResponse [ 'response' ]
1217+ }
1218+
12171219export type MergeElysiaInstances <
12181220 Instances extends Elysia < any , any , any , any , any , any > [ ] = [ ] ,
12191221 Prefix extends string = '' ,
0 commit comments