You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like this library, I'm trying to consume it in my project.
I have issue with exception handling. Maybe I don't understand how exceptions are design in library.
Nuget version 4.2.0.
I have a code like:
try
{
// projectId not exists - server will return 404.
var project = redmineManager.GetObject<Project>(projectId, null);
}
catch (Exception e)
{
// actions
}
I thought that e will be an exception derived from RedmineException but it's not.
This is what exception I have:
Exception: Name = "WebException" FullName = "System.Net.WebException" Message = "An exception occurred during a WebClient request."
InnerException: Name = "NotFoundException" FullName = "Redmine.Net.Api.Exceptions.NotFoundException" Message = "Not Found"
InnerException of InnerException: Name = "WebException" FullName = "System.Net.WebException" Message = "The remote server returned an error: (404) Not Found."
Is it right flow? In my code now I have to catch WebException and check InnerException. It shouldn't be RedmineException the most outer?
The text was updated successfully, but these errors were encountered:
I like this library, I'm trying to consume it in my project.
I have issue with exception handling. Maybe I don't understand how exceptions are design in library.
Nuget version 4.2.0.
I have a code like:
I thought that
e
will be an exception derived fromRedmineException
but it's not.This is what exception I have:
Is it right flow? In my code now I have to catch
WebException
and check InnerException. It shouldn't beRedmineException
the most outer?The text was updated successfully, but these errors were encountered: