diff --git a/jupyter-openbis-extension/dataset.py b/jupyter-openbis-extension/dataset.py
index f9ee9c78b2689e179916aea7dad6990c072f80f6..884c519c1a5159ab260f73208b55dae2dc3e0069 100644
--- a/jupyter-openbis-extension/dataset.py
+++ b/jupyter-openbis-extension/dataset.py
@@ -220,9 +220,9 @@ class DataSetUploadHandler(IPythonHandler):
                 files  = filenames,
             )
         except Exception as e:
-            print(e)
-            errors.append({
-                "create": 'Error while creating the dataset: {}'.format(e)
+            self.set_status(500)
+            self.write({
+                "reason": 'Error while creating the dataset: {}'.format(e)
             })
 
         # try to set the properties