Browse Source

rename error schema

Guénaël Muller 6 years ago
parent
commit
da5210d95d
3 changed files with 9 additions and 4 deletions
  1. 2 2
      tracim/__init__.py
  2. 1 1
      tracim/views/default/default_controller.py
  3. 6 1
      tracim/views/errors.py

+ 2 - 2
tracim/__init__.py View File

@@ -15,7 +15,7 @@ from tracim.lib.utils.authorization import AcceptAllAuthorizationPolicy
15 15
 from tracim.lib.utils.authorization import TRACIM_DEFAULT_PERM
16 16
 from tracim.views.core_api.session_controller import SessionController
17 17
 from tracim.views.default.default_controller import DefaultController
18
-from tracim.views.errors import Error
18
+from tracim.views.errors import ErrorSchema
19 19
 
20 20
 
21 21
 def main(global_config, **settings):
@@ -48,7 +48,7 @@ def main(global_config, **settings):
48 48
     hapic.set_context(
49 49
         PyramidContext(
50 50
             configurator=configurator,
51
-            default_error_builder=Error()
51
+            default_error_builder=ErrorSchema()
52 52
         )
53 53
     )
54 54
     # Add controllers

+ 1 - 1
tracim/views/default/default_controller.py View File

@@ -4,7 +4,7 @@ from pyramid.httpexceptions import HTTPNotFound
4 4
 from tracim import TracimRequest
5 5
 from tracim.extensions import hapic
6 6
 from tracim.views.controllers import Controller
7
-from tracim.views.errors import Error
7
+from tracim.views.errors import ErrorSchema
8 8
 from pyramid.config import Configurator
9 9
 
10 10
 

+ 6 - 1
tracim/views/errors.py View File

@@ -1,5 +1,10 @@
1 1
 from hapic.error import DefaultErrorBuilder
2 2
 
3 3
 
4
-class Error(DefaultErrorBuilder):
4
+class ErrorSchema(DefaultErrorBuilder):
5
+    """
6
+    This class is both a builder and a Marshmallow Schema, His named is used for
7
+    swagger ui error schema. That's why we call it ErrorSchema To have
8
+    a nice naming in swagger ui.
9
+    """
5 10
     pass