Closed ssijak closed 1 year ago
Hey @ssijak,
I do not think that adding a new property is necessary, you can check if the error is an instance of WretchError already:
import wretch from 'wretch'
const todo = await wretch("https://jsonplaceholder.typicode.com/todos/BAD_ID")
.get()
.json()
.catch(error => console.log("WretchError?", error instanceof wretch.WretchError))
// prints: WretchError? true
Self explanatory, it would allow us to easily distinguish if an error was wretch error or something else, e.g.: