Skip to content

How to get the "stack trace" string? #147

@kiwenlau

Description

@kiwenlau

I'm trying to get the "stacktrace" string and return it other than log it in the console. However, following code doesn't work...

    function getStacktrace() {

        var stringifiedStack;
        var callback = function(stackframes) {
            stringifiedStack = stackframes.map(function(sf) {
                return sf.toString();
            }).join('\n');
            //console.log(stringifiedStack);
        };

        var errback = function(err) {
            console.log(err.message);
        };

        StackTrace.get().then(callback).catch(errback);

        //console.log(stringifiedStack);
        return stringifiedStack;
    }

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