Splunk: Bugfix: Improve error logging logic #23
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please ensure your pull request (PR) adheres to the following guidelines:
Pull Request Checklist
Please check if your PR fulfills the following requirements:
<App Name>: <PR Type> - <PR Description>
next
branch of the forked repo. Create separate feature branch for raising the PR.Pull Request Type
Please check the type of change your PR introduces:
Security Considerations (REQUIRED)
please document them in the
readme.html
.readme.html
all methods (eg, OAuth) used to authenticatewith the service that the connector is integrating with.
readme.html
.the Vault API.
nosemgrep
?If yes, please provide justification in an additional comment next to the ignored code.
Release Notes (REQUIRED)
Completed - see the unreleased.md
What is the current behavior? (OPTIONAL)
A string constant is being used for the error message due to a reoccurring exception in the logic of the _get_error_message_from_exception method. This string constant provides no useful info to troubleshoot the cause of the exception that triggered the call of the _get_error_message_from_exception method.
What is the new behavior? (OPTIONAL)
Example logged error strings are below without and with code change. The example below is due to a load balancer for a Splunk Enterprise Search Head Cluster changing the Search Head server during a session which appears to be due to the open issue All Set-Cookie responses incorrectly assumed to be auth cookies # 438 for the Splunk Enterprise Python SDK.
Logged error string example without code change
“Failed to connect to splunk server. Error Code: Error code unavailable. Error Message: Error message unavailable. Please check the asset configuration and|or action parameters.”
Logged error string example with code change
Failed to connect to splunk server. Error Code: Error code unavailable. Error Message: HTTP Error 401: Unauthorized (1142)
Other information (OPTIONAL)
Pay close attention to (OPTIONAL)
Screenshots (if relevant)
Thanks for contributing!