summaryrefslogtreecommitdiff
path: root/matweb/frontend.py
diff options
context:
space:
mode:
authorJfriedli2021-03-23 21:20:54 +0100
committerJfriedli2021-03-23 21:20:54 +0100
commitc0d8d6c8eb74d839e520cd2e4429763208b478dd (patch)
tree2aa90ac6bb593a6a29ba357d3d840bcefcb644ad /matweb/frontend.py
parent501ecbf97e342c6d3a4c5d89131937f615cc98cf (diff)
catch newly thrown ValueErrors on get_file_parserv0.7.0
Diffstat (limited to '')
-rw-r--r--matweb/frontend.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/matweb/frontend.py b/matweb/frontend.py
index d29a2fb..395606f 100644
--- a/matweb/frontend.py
+++ b/matweb/frontend.py
@@ -64,11 +64,11 @@ def upload_file():
64 current_app.logger.error('Invalid Filename in upload') 64 current_app.logger.error('Invalid Filename in upload')
65 return redirect(request.url) 65 return redirect(request.url)
66 66
67 parser, mime = utils.get_file_parser(filepath) 67 try:
68 68 parser, mime = utils.get_file_parser(filepath)
69 if parser is None: 69 except ValueError:
70 flash('The type %s is not supported' % mime) 70 flash('The filetype is not supported')
71 current_app.logger.error('Unsupported type %s', mime) 71 current_app.logger.error('Unsupported filetype',)
72 return redirect(url_for('routes.upload_file')) 72 return redirect(url_for('routes.upload_file'))
73 73
74 try: 74 try: