diff options
| author | jfriedli | 2022-01-24 19:43:12 +0000 |
|---|---|---|
| committer | jfriedli | 2022-01-24 19:43:12 +0000 |
| commit | 71b00c20981eccf92ab7af0dc311543f077e327f (patch) | |
| tree | 6094c2c110395743165853a4706bb0139be9c1b0 /matweb | |
| parent | 8689aa3c3144dbe6a7b67facd176cf0d7dbf8cc6 (diff) | |
Bugfix catch attribute errors and updated dependencies
Diffstat (limited to 'matweb')
| -rw-r--r-- | matweb/frontend.py | 2 | ||||
| -rw-r--r-- | matweb/rest_api.py | 4 |
2 files changed, 3 insertions, 3 deletions
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(): | |||
| 86 | download_uri=url_for('routes.download_file', key=key, secret=secret, filename=output_filename), | 86 | download_uri=url_for('routes.download_file', key=key, secret=secret, filename=output_filename), |
| 87 | meta_after=meta_after, | 87 | meta_after=meta_after, |
| 88 | ) | 88 | ) |
| 89 | except (RuntimeError, ValueError): | 89 | except (RuntimeError, ValueError, AttributeError): |
| 90 | flash('The type %s could not be cleaned' % mime) | 90 | flash('The type %s could not be cleaned' % mime) |
| 91 | 91 | ||
| 92 | max_file_size = int(current_app.config['MAX_CONTENT_LENGTH'] / 1024 / 1024) | 92 | 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): | |||
| 69 | _external=True | 69 | _external=True |
| 70 | ) | 70 | ) |
| 71 | ), 201 | 71 | ), 201 |
| 72 | except ValueError: | 72 | except (ValueError, AttributeError): |
| 73 | current_app.logger.error('Upload - Invalid mime type') | 73 | current_app.logger.error('Upload - Invalid mime type') |
| 74 | abort(415, message='The filetype is not supported') | 74 | abort(415, message='The filetype is not supported') |
| 75 | except RuntimeError: | 75 | except RuntimeError: |
| @@ -119,7 +119,7 @@ class APIClean(Resource): | |||
| 119 | raise ValueError() | 119 | raise ValueError() |
| 120 | parser.remove_all() | 120 | parser.remove_all() |
| 121 | _, _, _, output_filename = utils.cleanup(parser, filepath, current_app.config['UPLOAD_FOLDER']) | 121 | _, _, _, output_filename = utils.cleanup(parser, filepath, current_app.config['UPLOAD_FOLDER']) |
| 122 | except ValueError: | 122 | except (ValueError, AttributeError): |
| 123 | current_app.logger.error('Upload - Invalid mime type') | 123 | current_app.logger.error('Upload - Invalid mime type') |
| 124 | abort(415, message='The filetype is not supported') | 124 | abort(415, message='The filetype is not supported') |
| 125 | except RuntimeError: | 125 | except RuntimeError: |
