@@ -39,16 +39,18 @@ class ACDException(ApiException):
3939 :param int code: The HTTP status code returned.
4040 :param str message: A message describing the error.
4141 :param str correlationId: A code to associate to the ACD error
42+ :param str errDescription: A description of the error if available.
4243 """
4344
44- def __init__ (self , code , message = None , correlation_id = None ):
45+ def __init__ (self , code , message = None , correlation_id = None , err_description = None ):
4546 self .message = message
4647 self .code = code
4748 self .correlation_id = correlation_id
49+ self .err_description = err_description
4850
4951 def __str__ (self ):
5052 msg = ('Error: ' + str (self .message ) + ', Code: ' + str (self .code )
51- + ', CorrelationId: ' + str (self .correlation_id ))
53+ + ', CorrelationId: ' + str (self .correlation_id ) + ', Description: ' + str ( self . err_description ) )
5254 return msg
5355
5456##############################################################################
@@ -134,9 +136,15 @@ def request_acd(self, request=None):
134136 and api_except .http_response .headers .get ('x-correlation-id' ) is not None
135137 ):
136138 correlation_id = api_except .http_response .headers .get ('x-correlation-id' )
139+ try :
140+ http_resp_json = api_except .http_response .json ()
141+ err_description = http_resp_json ['description' ]
142+ except :
143+ err_description = "None"
137144 else :
138145 correlation_id = "None"
139- raise ACDException (status_code , error_message , correlation_id )
146+ err_description = "None"
147+ raise ACDException (status_code , error_message , correlation_id , err_description )
140148
141149 return final
142150
0 commit comments