UNPKG

@tuentyfaiv/http

Version:

Library for http requests based on fetch

2 lines (1 loc) 501 B
class r extends Error{date;constructor(t="Error",...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,r),this.name=t,this.date=new Date}}class t extends Error{date;#r;constructor({title:r="!Connection Error¡",icon:e="error",time:a=4e3,...s},...c){super(...c),Error.captureStackTrace&&Error.captureStackTrace(this,t),this.name="ServiceError",this.message=s.message,this.date=new Date,this.#r={...s,title:r,icon:e,time:a}}view=()=>this.#r}export{r as CustomError,t as ServiceError};