88
99import os
1010import sys
11+
1112sys .path .insert (0 , os .path .abspath ('.' ))
1213
13- class Error :
1414
15+ class Error :
1516 """
16- contentstack. error
17+ >>> error = Error()
1718 ~~~~~~~~~~~~~~~~~~
1819 This module implements the Error class.
1920 API Reference: https://www.contentstack.com/docs/apis/content-delivery-api/#error
2021
2122 """
2223
2324 def __init__ (self ):
24- # It has some values to set error_msg, error_code etc..
2525 self .__error_dict = {}
2626 self .__error_code = str
2727 self .__msg = str
2828
2929 def _config (self , result : dict ):
30- # config error information
3130 if result is not None and len (result ) > 0 :
3231 self .__error_dict = result
3332 self .__error_code = self .__error_dict ['error_code' ]
@@ -36,7 +35,6 @@ def _config(self, result: dict):
3635
3736 @property
3837 def error_code (self ):
39-
4038 """
4139 It returns error code from the stack response
4240 :return: error_code as int
@@ -46,15 +44,14 @@ def error_code(self):
4644
4745 [Example:]
4846
49- >>> code = error .error_code
47+ >>> code = Error .error_code
5048
5149 ==============================
5250 """
5351 return self .__error_code
5452
5553 @property
5654 def error_message (self ):
57-
5855 """
5956 Returns error_message from the stack response
6057 :return: error_message
@@ -64,7 +61,7 @@ def error_message(self):
6461
6562 [Example:]
6663
67- >>> message = error .error_message
64+ >>> message = Error .error_message
6865
6966 ==============================
7067 """
@@ -73,7 +70,6 @@ def error_message(self):
7370
7471 @property
7572 def error (self ):
76-
7773 """
7874 This returns error code and error_message in dict formats
7975 :return: error dict
@@ -83,7 +79,7 @@ def error(self):
8379
8480 [Example:]
8581
86- >>> ode = error .error
82+ >>> ode = Error .error
8783
8884 ==============================
8985 """
@@ -92,7 +88,6 @@ def error(self):
9288
9389 @property
9490 def error_info (self ) -> dict :
95-
9691 """
9792 error information
9893 :return: error information
@@ -102,7 +97,7 @@ def error_info(self) -> dict:
10297
10398 [Example:]
10499
105- >>> ode = error .error_info
100+ >>> ode = Error .error_info
106101
107102 ==============================
108103 """
0 commit comments