Skip to content

Logging stack traces when environment is local #143

Description

@omarchehab98

When developing locally stack traces are crucial.

Scenario

// functions/__main__.js
const myBrokenHelper = require('../helper');

/**
* A basic Hello World function
* @param {string} name Who you're saying hello to
* @returns {string}
*/
module.exports = (name = 'world', context, callback) => {
  try {
    myBrokenHelper();
  } catch (e) {
    console.log(e.stack);
  }
  callback(null, `hello ${name}`);
};
// helper.js
module.exports = () => console.log(runtimeError)

Expected Outcome

$ lib .
ReferenceError: runtimeError is not defined
    at module.exports (/.../stdlib-stacktrace-pls/dev/hello-broken/help
er.js:1:98)
    at module.exports (/.../stdlib-stacktrace-pls/dev/hello-broken/func
tions/__main__.js:10:5)
    ...

Actual Outcome

$ lib .
Error: runtimeError is not defined

Activity

  1. self-assigned this
    on Apr 19, 2018
  2. keithwhor commented on Apr 19, 2018

    @keithwhor
    Contributor

    👍 I think this is reasonable. Let me get back to you on it.

  3. See887777 commented on Jan 14, 2022

    @See887777

    Cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions