Внести правку после ревью

This commit is contained in:
Roman Efremov 2024-12-12 11:56:20 +05:00
parent 21f7158fe5
commit 7f377fc14b

View File

@ -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;
} }
} }