dov-yih/resource-oriented-request

[BUG] Default onError(e) methods is Useless.

Closed this issue · 0 comments

Such as:

let {data} = await Post.get()

if Error arice.awat Post.get() will return undefined. But we except get a object like {data: { ... }}, So it will throw a TypeError. We have to catch it.

try{
  let {data} = await Post.get()
} catch(e) {
  console.log(e)
}

the goal of the onError method is to kill catch sentence. But the onError method did not play the effect we expected.