Merge branch 'ClientFactory' into TechMessageRework

This commit is contained in:
Roman Efremov 2024-12-12 11:57:36 +05:00
commit a28c5ac2c4

View File

@ -25,9 +25,11 @@ public static class ExceptionsHelper
public static Exception GetPersistenceException(this IApiResponse response)
{
var exception = ExceptionsDictionary
.FirstOrDefault(e => e.Key == response.StatusCode).Value ?? new Exception("Неопознанная ошибка");
ExceptionsDictionary
.TryGetValue(response.StatusCode, out var exception);
return exception;
var result = exception ?? new Exception("Неопознанная ошибка");
return result;
}
}