a-marenkov / gsheets

A Dart library for working with Google Sheets API.
Other
82 stars 31 forks source link

SocketException cannot be caught on iOS when no internet connection #93

Open tajquanghuy opened 1 year ago

tajquanghuy commented 1 year ago

when I call this function Future uploadFormData() async { final ggSheet = GSheets(credentials); final ss = await ggSheet.spreadsheet(spreadsheetId).catchError((error) { }); var sheet = ss.worksheetByTitle(spreadsheetName); sheet ??= await ss.addWorksheet(spreadsheetName).catchError((error) { }); final dataForms = await sheet.values.map.allRows().catchError((error) { //not caught error }); final index = (dataForms?.length ?? 0) + Constants.nextGoogleSheetRowPosition; return await sheet.values.insertRow(index, formData.getFormDataToList()).catchError((error) { //not caught error }); } final result = await uploadFormData().catchError((error){ //not caught error });