Skip to content

Problem in sending error report using Stacktrace.report #133

Closed
@sarker306

Description

@sarker306

I am using express 4.0 and I'm trying to send client side error from my angular app to server. I have exposed StackTrace as an angular service stacktraceService.

If I catch the error manually, and send them via a POST request like this:

     stacktraceService.StackTrace
        .fromError(exception)
        .then(function(stackframes){
            console.log(stackframes);
            $.ajax({
                type: "POST",
                url: "./error",
                contentType: "application/json",
                data: angular.toJson({
                    stack: stackframes
                })
            });
        });

The server side code can parse the req.body using "json()" method of express/body-parser and show it correctly.

However, if I use the stacktrace.js report functionality, like,

      stacktraceService.StackTrace
        .fromError(exception)
        .then(function(stackframes){
            console.log(stackframes);
            stacktraceService.StackTrace
            .report(stackframes, './error');
        });

,then the server side code finds the req.body undefined.

I was wondering what the cause would be. Am I using .report() functionality wrong?

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