게시글
질문&답변
axios timeout
안녕하세요.api 서버를 꺼버리고 테스트 했을때도timeout 시간동안 계속 시도하는걸로 이해했는데그게 아니었네요.api 서버에서 의도적으로 11초의 delay를 주니정상적인 timeout error가 발생한것을 확인했습니다.빠르고 정확한 답변에 감사드립니다.
- 0
- 3
- 141
질문&답변
axios timeout
안녕하세요.console로 찍어보니 아래와 같습니다. AxiosError {message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: {…}, request: XMLHttpRequest, …}code: "ERR_NETWORK"config:adapter: (3) ['xhr', 'http', 'fetch']allowAbsoluteUrls: truebaseURL: "http://localhost:58824/api/post"data: undefinedenv: {FormData: ƒ, Blob: ƒ}headers: AxiosHeaders {Accept: 'application/json, text/plain, /', Content-Type: undefined, X-Custom-Header: 'foobar'}maxBodyLength: -1maxContentLength: -1method: "get"timeout: 10000transformRequest: [ƒ]transformResponse: [ƒ]transitional: {silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false}url: "?group=1&page=1"validateStatus: ƒ validateStatus(status)xsrfCookieName: "XSRF-TOKEN"xsrfHeaderName: "X-XSRF-TOKEN"[[Prototype]]: Objectmessage: "Network Error"name: "AxiosError"request: XMLHttpRequest {onreadystatechange: null, readyState: 4, timeout: 10000, withCredentials: false, upload: XMLHttpRequestUpload, …}stack: "AxiosError: Network Error\n at XMLHttpRequest.handleError (http://localhost:3000/node_modules/.vite/deps/axios.js?v=597761da:1542:14)\n at Axios.request (http://localhost:3000/node_modules/.vite/deps/axios.js?v=597761da:2062:41)\n at async fetchPosts (http://localhost:3000/src/components/PostListComponent.vue?t=1745193941392:39:22)"[[Prototype]]: Error
- 0
- 3
- 141