mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/api: handle connection errors
This commit is contained in:
@ -31,7 +31,9 @@ class Api {
|
||||
req.set('Accept', 'application/json')
|
||||
.end((error, response) => {
|
||||
if (error) {
|
||||
reject(response.body);
|
||||
reject(response && response.body ? response.body : {
|
||||
'title': 'Networking error',
|
||||
'description': error.message});
|
||||
} else {
|
||||
resolve(response.body);
|
||||
}
|
||||
|
Reference in New Issue
Block a user