You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{fatcher}from'fatcher';import{isFatcherError,exception}from'@fatcherjs/middleware-exception';fatcher('https://foo.bar',{middlewares: [exception]}).catch(error=>{if(isFatcherError(error)){// handle fatcher errorreturn;}// handle other error});
options
validateCode
import{fatcher}from'fatcher';import{isFatcherError,exception}from'@fatcherjs/middleware-exception';fatcher('https://foo.bar',{middlewares: [exception],// throw FatcherError when status is not 200validateCode: status=>status===200,}).catch(error=>{if(isFatcherError(error)){// handle fatcher errorreturn;}// handle other error});