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

knollfear/bcda-554 Handling errors in order to allow for the running of Gosec test G104 #85

merged 1 commit into from Dec 4, 2018


None yet
2 participants

knollfear commented Nov 30, 2018

Fixes BCDA-554

GoSec currently isn't running test G104 which looks for unhandled errors. This PR adds in error handling for all places it was missing and enables that test

Proposed changes:

Handled potential error with opening of Key FIles
Handled potential error with setting of environment variables
Handled potential error with closing of files
Handled potential errors with marshalling of JSON data
Handled potential errors with opening DB connection
Handled potential errors with closing of serviceMUX
handled potential errors with flushing of writer
handled potential errors with removing directory

Change Details

Most errors are handled in ways similar to other errors within the function. As these errors were previously unhandled it shouldn't cause any problems to now handle them explicitly

Security Implications

no PII should be affected

Acceptance Validation

Run make test and verify that tests complete and that GOSEC runs test G104

Feedback Requested

Is the handling of the errors correct? Should we just #nosec any of these instead?

@knollfear knollfear requested review from tbellj, embh and DeirdreHolub Nov 30, 2018


rnagle approved these changes Dec 3, 2018

Nicely done. 🚀

@knollfear knollfear merged commit d0c41ed into master Dec 4, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

@knollfear knollfear deleted the knollfear/bcda-554 branch Dec 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment