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

autoProfiling: false and stop doesn't return a promise #6

Open
petermorlion opened this issue Jan 8, 2019 · 0 comments
Open

autoProfiling: false and stop doesn't return a promise #6

petermorlion opened this issue Jan 8, 2019 · 0 comments

Comments

@petermorlion
Copy link

In the agent.js file, I see this piece of code:

if (!self.getOption('autoProfiling')) {
    return self._report(reporter, () => {
        self.isProfiling = false;

        callback();
    });
} 
else {
    self.isProfiling = false;

    if (callback) {
      callback();
    } 
    else {
        return Promise.resolve();
    }
}

Shouldn't the first block in the if-statement also be able to return a promise? I encountered this issue because I had set the autoProfiling to false, but am working with async/await. I get an error at the end of my Lambda that the callback is not a function. This is to be expected, as I didn't provide one.

I can supply a PR, but wanted to check if this was a deliberate decision.

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

No branches or pull requests

1 participant