changeset 92:2200ae1e7bdb

Rename html_error_code to http_error_code The new name is obviously what the parameter actually specifies. Not least because there is no such thing as an HTML error code.
author Bernhard Herzog <bh@intevation.de>
date Fri, 28 Apr 2017 19:03:36 +0200
parents 607694092e2e
children 48dabf4bf680
files odfcast/convert.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/odfcast/convert.py	Thu May 26 21:21:18 2016 +0200
+++ b/odfcast/convert.py	Fri Apr 28 19:03:36 2017 +0200
@@ -37,10 +37,10 @@
     BAD_REQUEST_ERROR_CODE = 400
 
     def __init__(self, title, error_code, details,
-                 html_error_code=BAD_REQUEST_ERROR_CODE):
+                 http_error_code=BAD_REQUEST_ERROR_CODE):
         data, mime_type = self.get_response_data(title, error_code, details)
         super(ErrorResponse, self).__init__(response=data, mimetype=mime_type,
-                                            status=html_error_code)
+                                            status=http_error_code)
 
     def json(self, title, error_code, details):
         return json.dumps({
@@ -82,7 +82,7 @@
     def __init__(self, details, error_code=TEMPLATE_ERROR_CODE):
         super(TemplateErrorResponse, self).__init__(
             title="TemplateError", error_code=error_code, details=details,
-            html_error_code=500)
+            http_error_code=500)
 
 
 class ConversionErrorResponse(ErrorResponse):
@@ -92,7 +92,7 @@
     def __init__(self, details, error_code=CONVERSION_ERROR_CODE):
         super(ConversionErrorResponse, self).__init__(
             title="ConversionError", error_code=error_code, details=details,
-            html_error_code=500)
+            http_error_code=500)
 
 
 class MergeErrorResponse(ErrorResponse):
@@ -102,7 +102,7 @@
     def __init__(self, details, error_code=MERGE_ERROR_CODE):
         super(MergeErrorResponse, self).__init__(
             title="MergeError", error_code=error_code, details=details,
-            html_error_code=500)
+            http_error_code=500)
 
 
 class ConvertView(MethodView):
@@ -125,14 +125,14 @@
             return ErrorResponse(
                 "Upload file missing", error_code=101,
                 details="Please upload a file for conversion",
-                html_error_code=400)
+                http_error_code=400)
 
         fformat = request.form['format']
         if not self.is_format_supported(fformat):
             return ErrorResponse(
                 "Invalid format", error_code=102,
                 details="Format %s not allowed" % fformat,
-                html_error_code=400)
+                http_error_code=400)
 
         datadict = self.get_datadict()
 
@@ -252,7 +252,7 @@
             return ErrorResponse(
                 "Upload file missing", error_code=101,
                 details="Please upload a file for conversion",
-                html_error_code=400)
+                http_error_code=400)
 
         with tempfile.TemporaryFile() as outfile:
             merger = PdfFileMerger(strict=False)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)