Skip to content

Service functions: Consistent exception handling and error logging#3214

Merged
WardBrian merged 4 commits intodevelopfrom
fix/services-exceptions-error-logging
Jul 27, 2023
Merged

Service functions: Consistent exception handling and error logging#3214
WardBrian merged 4 commits intodevelopfrom
fix/services-exceptions-error-logging

Conversation

@WardBrian
Copy link
Member

Submission Checklist

  • Run unit tests: ./runTests.py src/test/unit
  • Run cpplint: make cpplint
  • Declare copyright holder and open-source license: see below

Summary

Currently, the services functions are inconsistent on whether or not they will throw an exception. The versions which accept num_chains should never throw, but the older ones will throw if initialization fails.
This consistently puts utils::initialize in a try block.

Additionally, we are currently using logger.info for messages which are errors, and in several places not logging an error where we could (e.g., the catch blocks accompanying the above trys).

Intended Effect

Improved error logging and exception safety in the services functions

How to Verify

Side Effects

Documentation

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):

Simons Foundation

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

@WardBrian WardBrian merged commit 87bc0aa into develop Jul 27, 2023
@WardBrian WardBrian deleted the fix/services-exceptions-error-logging branch July 27, 2023 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants