1212import requests
1313import tarfile
1414import tempfile
15+ import xml .etree .ElementTree as ET
1516import uuid
1617from io import open
1718from re import (search , match , compile )
@@ -334,17 +335,16 @@ def handle_asc_exception(ex):
334335 try :
335336 raise CLIError (ex .inner_exception .error .message )
336337 except AttributeError :
337- logger .warning (f"CLIError ex: { ex } " )
338- logger .warning (f"CLIError ex.response.internal_response.text: { ex .response .internal_response .text } " )
338+ logger .debug (f"CLIError ex: { ex } " )
339+ logger .debug (f"CLIError ex.response.internal_response.text: { ex .response .internal_response .text } " )
339340 if hasattr (ex , 'response' ) and ex .response .internal_response .text :
340- logger .warning ("CLIError: Trying to parse the exception message." )
341+ logger .debug ("CLIError: Trying to parse the exception message." )
341342 try :
342343 response_dict = json .loads (ex .response .internal_response .text )
343- logger .warning (f"CLIError response_dict: { response_dict } " )
344+ logger .debug (f"CLIError response_dict: { response_dict } " )
344345 raise CLIError (response_dict ["error" ]["message" ])
345346 except json .JSONDecodeError :
346347 # Try to extract error from XML format
347- import xml .etree .ElementTree as ET
348348 try :
349349 root = ET .fromstring (ex .response .internal_response .text )
350350 # Look for common error message patterns in XML
@@ -360,7 +360,7 @@ def handle_asc_exception(ex):
360360 # If both JSON and XML parsing fail, return the raw text
361361 raise CLIError (ex .response .internal_response .text )
362362 else :
363- logger .warning ("CLIError: Unable to parse the exception message." )
363+ logger .debug ("CLIError: Unable to parse the exception message." )
364364 raise CLIError (ex )
365365
366366
0 commit comments