fix: clear regression and extension recovers response for error status codes

This commit is contained in:
Andrew Bastin
2023-09-18 18:23:37 +05:30
parent f5b130024e
commit bcc1147f81
2 changed files with 8 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ import * as E from "fp-ts/Either"
import {
Interceptor,
InterceptorError,
NetworkResponse,
RequestRunResult,
} from "../../../services/interceptor.service"
import axios, { AxiosRequestConfig, CancelToken } from "axios"
@@ -51,7 +52,7 @@ async function runRequest(
const timeEnd = Date.now()
return E.right({
return E.right(<NetworkResponse>{
...res,
config: {
timeData: {
@@ -64,7 +65,7 @@ async function runRequest(
const timeEnd = Date.now()
if (axios.isAxiosError(e) && e.response) {
return E.right({
return E.right(<NetworkResponse>{
...e.response,
config: {
timeData: {