Handle unexpected sharing responses
This commit is contained in:
parent
149190e964
commit
f78ad0ab61
@ -184,9 +184,6 @@ function shareRecording(context) {
|
|||||||
return reject(error);
|
return reject(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the response body
|
|
||||||
body = JSON.parse(body);
|
|
||||||
|
|
||||||
// Internal server error
|
// Internal server error
|
||||||
if (response.statusCode == 500) {
|
if (response.statusCode == 500) {
|
||||||
return reject(body.errors.join('\n'));
|
return reject(body.errors.join('\n'));
|
||||||
@ -204,6 +201,14 @@ function shareRecording(context) {
|
|||||||
return resolve();
|
return resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unexpected error
|
||||||
|
if (response.statusCode != 200) {
|
||||||
|
return reject(new Error('Something went wrong, try again later'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse the response body
|
||||||
|
body = JSON.parse(body);
|
||||||
|
|
||||||
resolve(body.url);
|
resolve(body.url);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user