Skip to content

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

@petermorlion

Description

@petermorlion

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions