File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
src/service/worker/runtime/http/middlewares Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 1- import { AxiosError } from 'axios'
21import { IOClients } from '../../../../../clients/IOClients'
32import { LINKED } from '../../../../../constants'
43import {
@@ -103,13 +102,12 @@ export async function error (ctx: ServiceContext, next: () => Promise<void>) {
103102 const err = cleanError ( e )
104103
105104 // Add response
106- if ( e instanceof AxiosError ) {
107- ctx . status = e ?. status && e . status >= 400 && e . status <= 599
108- ? e . status
109- : ctx . status >= 500 && ctx . status <= 599
110- ? ctx . status
111- : 500
112- }
105+ ctx . status = e ?. status && e . status >= 400 && e . status <= 599
106+ ? e . status
107+ : ctx . status >= 500 && ctx . status <= 599
108+ ? ctx . status
109+ : 500
110+
113111 // Do not generate etag for errors
114112 ctx . remove ( META_HEADER )
115113 ctx . remove ( ETAG_HEADER )
You can’t perform that action at this time.
0 commit comments