'NodeJS Google API: create and write to sheet

I want to create a new file and write the data there.

return sheets.spreadsheets.create(createOption).then(response => {
        return sheets.spreadsheets.values.append(
          {
              spreadsheetId: response.data.spreadsheetId,
              range: 'A:A',
              valueInputOption: 'RAW',
              resource: resource,
          }).then(result => {
            return {isOk: true, data: result}
        }).catch(error => {
            return {isOk: false, error}
        });
    }).catch(error => {
        return {isOk: false, error}
    })

This code used to work, but now it doesn't give an error or a result. And I can't understand what happened.

try {} catch also does not catch errors. are there any other ways to figure out what's wrong?

const createOption = {
        resource: {
            properties: {
                title: 'Subscribe #' + sub_id
            }
        }
    };


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source