Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda