Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging stack traces when environment is local #143

Open
omarchehab98 opened this issue Mar 31, 2018 · 2 comments
Open

Logging stack traces when environment is local #143

omarchehab98 opened this issue Mar 31, 2018 · 2 comments
Assignees

Comments

@omarchehab98
Copy link

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
@keithwhor keithwhor self-assigned this Apr 19, 2018
@keithwhor
Copy link
Contributor

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

@See887777
Copy link

Cc

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

No branches or pull requests

3 participants