-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle errors from update_goal_state #1758
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1758 +/- ##
==========================================
Coverage ? 69.14%
==========================================
Files ? 82
Lines ? 11717
Branches ? 1643
==========================================
Hits ? 8102
Misses ? 3263
Partials ? 352
Continue to review full report at Codecov.
|
except Exception as e: | ||
msg = u"Exception retrieving the goal state: {0}".format(ustr(traceback.format_exc())) | ||
logger.warn(msg) | ||
add_event(AGENT_NAME, op=WALAEventOperation.FetchGoalState, version=CURRENT_VERSION, is_success=False, message=msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't add_event
also log the message if is_success=False
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks; removed
When I moved the call to update_goal_state from get_vmagent_manifests/get_ext_handlers to the main loop I did not notice it does not handle exceptions.
The purpose of this PR is to handle exceptions mimicking what the original code did. 3 TODOs for subsequent PRs:
Verified the fix manually raising an exception from the debugger on a live agent.
This change is