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/frontend.py | 2 +- matweb/rest_api.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'matweb') diff --git a/matweb/frontend.py b/matweb/frontend.py index 395606f..018fc97 100644 --- a/matweb/frontend.py +++ b/matweb/frontend.py @@ -86,7 +86,7 @@ def upload_file(): download_uri=url_for('routes.download_file', key=key, secret=secret, filename=output_filename), meta_after=meta_after, ) - except (RuntimeError, ValueError): + except (RuntimeError, ValueError, AttributeError): flash('The type %s could not be cleaned' % mime) max_file_size = int(current_app.config['MAX_CONTENT_LENGTH'] / 1024 / 1024) 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