Allow 201 as success in test result

This commit is contained in:
Jamie Curnow 2023-03-30 12:51:26 +10:00
parent 5d03ede100
commit 8a4a7d0caf
No known key found for this signature in database
GPG Key ID: FFBB624C43388E9E

View File

@ -126,7 +126,7 @@ BackendApi.prototype._putPostJson = function(fn, path, data, returnOnError) {
logger('Response data:', data);
if (!returnOnError && data instanceof Error) {
reject(data);
} else if (!returnOnError && response.statusCode != 200) {
} else if (!returnOnError && (response.statusCode < 200 || response.statusCode >= 300)) {
if (typeof data === 'object' && typeof data.error === 'object' && typeof data.error.message !== 'undefined') {
reject(new Error(data.error.code + ': ' + data.error.message));
} else {