trainline / consul-deployment-agent

Cross-platform deployment agent for Environment Manager
Other
1 stars 0 forks source link

Wrap the failure in a try block and continue to ship logs to S3. #54

Closed tl-jakecross closed 6 years ago

tl-jakecross commented 6 years ago

When an error is generated within the run method of the agent, it was throwing out to the caller, and handling the error with logging.exception. this meant the shipping of logs to S3 which happens within self._finalise_log was not getting called. As a result, certain error types weren't being made available to users within the UI of Environment Manager - resulting in a 500 error.

The loop around all deployment stages is now wrapped in a try/except statement. If there is a thrown error now, it will still behave the same way when it comes to using logging.exception (as that was handled in the caller previously) but it will also finalise the log and ship what it has to S3.

ghost commented 6 years ago

👍