File tree Expand file tree Collapse file tree
HwProj.APIGateway/HwProj.APIGateway.API/ExportServices Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,9 +71,19 @@ public async Task<Result> Export(
7171 await updateRequest . ExecuteAsync ( ) ;
7272 result = Result . Success ( ) ;
7373 }
74- catch ( Exception e )
74+ catch ( GoogleApiException ex )
7575 {
76- result = Result . Failed ( $ "Ошибка: { e . Message } ") ;
76+ var message = $ "Ошибка при обращении к Google Sheets: { ex . Message } ";
77+ if ( ex . Error . Code == ( int ) HttpStatusCode . NotFound )
78+ {
79+ message = "Таблица не найдена, проверьте корректность ссылки" ;
80+ }
81+ else if ( ex . Error . Code == ( int ) HttpStatusCode . Forbidden )
82+ {
83+ message = "Нет прав не редактирование таблицы, проверьте настройки доступа" ;
84+ }
85+
86+ return Result . Failed ( message ) ;
7787 }
7888
7989 return result ;
@@ -99,7 +109,7 @@ public async Task<Result<string[]>> GetSheetTitles(string sheetUrl)
99109 }
100110 else if ( ex . Error . Code == ( int ) HttpStatusCode . Forbidden )
101111 {
102- message = "Нет прав не редактирование таблицы , проверьте настройки доступа" ;
112+ message = "Нет прав не получение данных о таблице , проверьте настройки доступа" ;
103113 }
104114
105115 return Result < string [ ] > . Failed ( message ) ;
You can’t perform that action at this time.
0 commit comments