diff --git a/IPython/html/static/services/contents.js b/IPython/html/static/services/contents.js
index c2ee4ba..11c2255 100644
--- a/IPython/html/static/services/contents.js
+++ b/IPython/html/static/services/contents.js
@@ -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;
}
);
};