Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
What attributes are accessible for 'error' objects in Google Apps Script?

I am working on adding error handling into my Google Sheets based web app. After investigating try/catch blocks, it's clear that it would be best practice to specify what action to take depending on the exact nature of the error. I have begun testing with errors, but I am unable to find a complete resource that details exactly what attributes of the error can be utilized. For reference, here is the try/catch block in my test function:

try{
    var url = "jdbc:mysql://"+SERVER+":"+PORT+"/"+DB_DEV;
    var conn = Jdbc.getConnection(url, USERNAME, PASSWORD);

    // Sends connection to prepare SQL statements
    return conn;
  } catch(e){
    Logger.log(e);          
    Logger.log(e.stack);    // Valid
    Logger.log(e.message);  // Valid
    Logger.log(e.name);     // Valid

    Logger.log(e.type);     // Invalid

    return null;
  }

In the above example, "stack", "message", and "name" are all valid attributes, but I was only able to find them via trial and error looking through others' example code. My question is - could someone point me in the direction of a resource that would detail error objects in Google Apps Script?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Apps script uses a standard chrome v8 engine based on javascript. All standard properties of the javascript error object are available(i.e., name and message). Some non standard properties like stack is also available on the v8 engine.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!