mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
also handle error.detail
This commit is contained in:
parent
55058b8b34
commit
55f00ea0ab
@ -35,6 +35,8 @@ class Requests {
|
||||
let error = new Error('Form Error');
|
||||
error.json = body;
|
||||
reject(error);
|
||||
} else if(body && body.detail) {
|
||||
reject(new Error(body.detail));
|
||||
} else {
|
||||
resolve(body);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user