Re-raise errors with throw instead of Promise.reject()

This commit is contained in:
Thomas Kluyver 2014-11-13 14:25:28 -08:00
parent 0295f5a487
commit 1e53c1f924

View File

@ -129,9 +129,9 @@ define([
// TODO: update IPEP27 to specify errors more precisely, so
// that error types can be detected here with certainty.
if (error.xhr.status === 400) {
return Promise.reject(new Contents.DirectoryNotEmptyError());
throw new Contents.DirectoryNotEmptyError();
}
return Promise.reject(error);
throw error;
}
);
};