Sangil's blog

https://github.com/ChoiSangIl Admin

vue axios timeout exception 오류코드 DEV / WEB

2021-02-19 posted by sang12


뷰에서 axios를 사용할때 timeout을 걸 수 있는데, 타임아웃 오류를 잡는 방법은 다음과 같다. 

        switcherror.code ){
            case 'ECONNABORTED':
                //alert("검색시간을 초과하였습니다.");
                console.log("timeout exception");
            break;
        }

ECONNABORTED <-- 란 코드로 잡으면 된다~

REPLY