File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
packages/plantae/src/axios Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " plantae " : patch
3+ ---
4+
5+ fix: import axios dynamically
Original file line number Diff line number Diff line change 11import type { AxiosResponse } from "axios" ;
2- import { AxiosError } from "axios" ;
32
43// https://github.com/axios/axios/blob/7d45ab2e2ad6e59f5475e39afd4b286b1f393fc0/lib/core/settle.js#L15
54export default function settle (
@@ -11,15 +10,17 @@ export default function settle(
1110 if ( ! response . status || ! validateStatus || validateStatus ( response . status ) ) {
1211 resolve ( response ) ;
1312 } else {
14- reject (
15- new AxiosError (
16- "Request failed with status code " + response . status ,
17- [ AxiosError . ERR_BAD_REQUEST , AxiosError . ERR_BAD_RESPONSE ] [
18- Math . floor ( response . status / 100 ) - 4
19- ] ,
20- response . config ,
21- response . request ,
22- response
13+ import ( "axios" ) . then ( ( { AxiosError } ) =>
14+ reject (
15+ new AxiosError (
16+ "Request failed with status code " + response . status ,
17+ [ AxiosError . ERR_BAD_REQUEST , AxiosError . ERR_BAD_RESPONSE ] [
18+ Math . floor ( response . status / 100 ) - 4
19+ ] ,
20+ response . config ,
21+ response . request ,
22+ response
23+ )
2324 )
2425 ) ;
2526 }
You can’t perform that action at this time.
0 commit comments