Browse Source

Update main.py

pull/5/head
Mathias Markl 7 years ago
committed by GitHub
parent
commit
a6255d2a3b
  1. 4
      muk_web_preview_msoffice/controllers/main.py

4
muk_web_preview_msoffice/controllers/main.py

@ -94,7 +94,7 @@ class MSOfficeParserController(http.Controller):
return response return response
except KeyError: except KeyError:
return werkzeug.exceptions.UnsupportedMediaType(_("The file couldn't be converted. Unsupported mine type.")) return werkzeug.exceptions.UnsupportedMediaType(_("The file couldn't be converted. Unsupported mine type."))
except (ImportError, IOError, WindowsError) as error:
except (ImportError, IOError, OSError) as error:
_logger.error(error) _logger.error(error)
return werkzeug.exceptions.InternalServerError(_("An error occurred during the process. Please contact your system administrator.")) return werkzeug.exceptions.InternalServerError(_("An error occurred during the process. Please contact your system administrator."))
@ -120,4 +120,4 @@ class MSOfficeParserController(http.Controller):
headers = [('Content-Type', 'application/pdf'), headers = [('Content-Type', 'application/pdf'),
('Content-Disposition', 'attachment;filename="{}";'.format(filename)), ('Content-Disposition', 'attachment;filename="{}";'.format(filename)),
('Content-Length', len(file))] ('Content-Length', len(file))]
return request.make_response(file, headers)
return request.make_response(file, headers)
Loading…
Cancel
Save