fix: suppress Authorize.net SDK XML parsing error during startup
- Temporarily disable authorizenet.sdk logger during credential validation - Prevents ContentNondeterminismExceededError from appearing in logs - Error is a known PyXB issue in the SDK that doesn't affect functionality - Credentials are still validated correctly
This commit is contained in:
11
app/main.py
11
app/main.py
@@ -115,8 +115,19 @@ def validate_authorize_credentials():
|
||||
else:
|
||||
controller.setenvironment(constants.SANDBOX)
|
||||
|
||||
# Suppress the SDK's XML parsing error (ContentNondeterminismExceededError)
|
||||
# This is a known issue with the authorizenet SDK's PyXB dependency
|
||||
# The error doesn't affect functionality, just creates noise in logs
|
||||
authorizenet_logger = logging.getLogger('authorizenet.sdk')
|
||||
original_level = authorizenet_logger.level
|
||||
authorizenet_logger.setLevel(logging.CRITICAL)
|
||||
|
||||
try:
|
||||
controller.execute()
|
||||
response = controller.getresponse()
|
||||
finally:
|
||||
# Restore original logging level
|
||||
authorizenet_logger.setLevel(original_level)
|
||||
|
||||
if response is None:
|
||||
raise ValueError("Could not connect to Authorize.net - check network connectivity")
|
||||
|
||||
Reference in New Issue
Block a user