Added mixin
Some checks failed
Build / Build NPM Project (push) Failing after 0s
Build / Tag Version (push) Has been skipped
Build / Publish (push) Has been skipped

This commit is contained in:
2024-04-11 23:19:36 -04:00
parent c8ccc19996
commit 85fc5f3017
7 changed files with 61 additions and 61 deletions

View File

@ -1,6 +1,6 @@
import {XHR} from './xhr';
XHR.addInterceptor((resp: Response, next: () => {}) => {
XHR.addInterceptor((resp: Response, next: () => void) => {
if(resp.status == 200) return next();
if(resp.status == 400) throw new BadRequestError(resp.statusText);
if(resp.status == 401) throw new UnauthorizedError(resp.statusText);