File tree Expand file tree Collapse file tree
HwProj.APIGateway/HwProj.APIGateway.API Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919using IStudentsInfo ;
2020using StudentsInfo ;
2121using Newtonsoft . Json . Linq ;
22+ using System ;
2223
2324namespace HwProj . APIGateway . API
2425{
@@ -94,7 +95,14 @@ private static JToken Serialize(IConfigurationSection configurationSection)
9495 private static SheetsService ConfigureGoogleSheets ( IConfigurationSection _sheetsConfiguration )
9596 {
9697 var jsonObject = Serialize ( _sheetsConfiguration ) ;
97- var credential = GoogleCredential . FromJson ( jsonObject . ToString ( ) ) . CreateScoped ( SheetsService . Scope . Spreadsheets ) ;
98+ GoogleCredential ? credential = null ;
99+
100+ try
101+ {
102+ credential = GoogleCredential . FromJson ( jsonObject . ToString ( ) )
103+ . CreateScoped ( SheetsService . Scope . Spreadsheets ) ;
104+ }
105+ catch ( Exception ) { }
98106
99107 return new SheetsService ( new BaseClientService . Initializer
100108 {
You can’t perform that action at this time.
0 commit comments