Skip to content
This repository was archived by the owner on Nov 16, 2019. It is now read-only.
This repository was archived by the owner on Nov 16, 2019. It is now read-only.

Add "stex.reportError" helper function #50

@nullstyle

Description

@nullstyle

It's come to my attention that in stellar-api we're forwarding any call to stex.error.log to sentry. This is not a good situation. It means that error reports in stellar-api are actually just log lines that alias most of the useful information encoded into a Error object. It seems that this solution was chosen because we did not have defined with stex a reusable system to report errors.

We should add this functionality at stex.reportError which should behave similar to the stex errors middleware: It logs as well as reports to sentry as peer operations, not dependent ones. From the code:

    var reportErrorDirectly = function(err) {
        log.error(err.message);
        // report to sentry if we are enabled
        if(sentry) {
            sentry.captureError(err);
        }
    };

I propose we extract that functionality to a method stex.reportError, such that the above code becomes:

    var reportErrorDirectly = function(err) {
        stex.reportError(err);
    };

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions