Внести правку после ревью
This commit is contained in:
parent
21f7158fe5
commit
7f377fc14b
@ -25,9 +25,11 @@ public static class ExceptionsHelper
|
|||||||
|
|
||||||
public static Exception GetPersistenceException(this IApiResponse response)
|
public static Exception GetPersistenceException(this IApiResponse response)
|
||||||
{
|
{
|
||||||
var exception = ExceptionsDictionary
|
ExceptionsDictionary
|
||||||
.FirstOrDefault(e => e.Key == response.StatusCode).Value ?? new Exception("Неопознанная ошибка");
|
.TryGetValue(response.StatusCode, out var exception);
|
||||||
|
|
||||||
return exception;
|
var result = exception ?? new Exception("Неопознанная ошибка");
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user