#646 Репозиторий Хранения названий источников данных от систем #11

Merged
on.nemtina merged 9 commits from DataSourceSystem into master 2024-12-16 09:47:15 +05:00
Showing only changes of commit a28c5ac2c4 - Show all commits

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