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
OTC-586 Implement "using" for all disposable elements (streams, connections, writers) #151
Conversation
There is lots of changes, I guess I need someone more experienced in c# to review and maybe to test. I would like to have some test on the sit server. @hirensoni913 can you see what you can do ? |
@@ -25,25 +25,8 @@ public ImisCoverage(IConfiguration configuration) | |||
SqlParameter[] sqlParameters = { | |||
new SqlParameter("@InsureeNumber", insureeNumber), | |||
}; | |||
DataTable response = new DataTable(); | |||
|
|||
try |
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.
Why the Try/Catch block is removed? Can't we log the error rather than removing it?
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.
Because this block just rethrowed the sql exception and replaced any other exception with empty generic exception, crashing the endpoint and hiding the cause. Without it the escaped exception will be caught and logged
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.
@malinowskikam can you add the proper exception handling in the catch blocks?
@malinowskikam Can you also look in to the "GepgFileLogger" file. This file contains lots of IO operations. We need to use the using block in it + log the exceptions in proper way |
19f1c74
to
caad415
Compare
@hirensoni913 I updated the empty error handlers in the payment controller and logic. Also I refactored GepgFileLogger |
https://openimis.atlassian.net/browse/OTC-586
Changes:
using
using
using
LoggerFactory
to various componentsGepgFileLogger.cs
override
operators