Update Error raising in uploads and image processing
This commit is contained in:
@@ -44,7 +44,7 @@ class Web:
|
||||
file_uploaded = self.upload_file(image)
|
||||
except Exception as e:
|
||||
self.app.logger.error(e)
|
||||
raise RuntimeError("Could not upload file") from e
|
||||
raise RuntimeError("Could not upload file : " + str(e)) from e
|
||||
|
||||
if file_uploaded:
|
||||
self.app.logger.debug("File has been uploaded, printing...")
|
||||
@@ -100,7 +100,7 @@ class Web:
|
||||
image.save(os.path.join(self.app.config["UPLOAD_FOLDER"], filename))
|
||||
except OSError as e:
|
||||
self.app.logger.error("Could not save file %s", e)
|
||||
return False
|
||||
raise RuntimeError("An OS error occured while uploading this file : " + str(e)) from e
|
||||
|
||||
self.app.logger.debug(
|
||||
"File saved to "
|
||||
@@ -111,7 +111,7 @@ class Web:
|
||||
self.app.logger.error(
|
||||
"Could not save file because the filename is forbidden"
|
||||
)
|
||||
return False
|
||||
raise RuntimeError("This file type is forbidden.")
|
||||
|
||||
def get_queue_state(self):
|
||||
"""Return current queue state"""
|
||||
|
||||
Reference in New Issue
Block a user