From 71b00c20981eccf92ab7af0dc311543f077e327f Mon Sep 17 00:00:00 2001 From: jfriedli Date: Mon, 24 Jan 2022 19:43:12 +0000 Subject: Bugfix catch attribute errors and updated dependencies --- matweb/rest_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'matweb/rest_api.py') diff --git a/matweb/rest_api.py b/matweb/rest_api.py index 49e7183..0c00331 100644 --- a/matweb/rest_api.py +++ b/matweb/rest_api.py @@ -69,7 +69,7 @@ class APIUpload(Resource): _external=True ) ), 201 - except ValueError: + except (ValueError, AttributeError): current_app.logger.error('Upload - Invalid mime type') abort(415, message='The filetype is not supported') except RuntimeError: @@ -119,7 +119,7 @@ class APIClean(Resource): raise ValueError() parser.remove_all() _, _, _, output_filename = utils.cleanup(parser, filepath, current_app.config['UPLOAD_FOLDER']) - except ValueError: + except (ValueError, AttributeError): current_app.logger.error('Upload - Invalid mime type') abort(415, message='The filetype is not supported') except RuntimeError: -- cgit v1.3