Skip to content

captureMessage works, while captureException does not. #358

Closed
@bfw

Description

@bfw

When I test error logging from my browser console, using captureMessage works fine, meaning that the message is logged in Sentry:
try { throw new Error('what') } catch (e) { Raven.captureMessage(e.message) }

However, using captureException does not result in an error logged in Sentry:
try { throw new Error('what') } catch (e) { Raven.captureException(e) }

My config only contains the whitelistUrls.

Activity

dcramer

dcramer commented on Jul 25, 2015

@dcramer
Member

I'm also seeing something that I have to assume is related:

var err = new Error('Own Error'); 
Raven.captureMessage('CaptMessage', {extra: { stackTrace: err.stack }}); 
Raven.captureException(err);

Repro'd on 1.1.19, confirmed its a client issue.

The value sent to the server has the entire object of frames as a string value, thus Sentry discards the stacktrace.

(There are other issues with this as well, such as the Sentry event having "undefined" as the title when clearly it should be able to have a value since err.toString() works just fine)

dcramer

dcramer commented on Jul 25, 2015

@dcramer
Member

Semi-unrelated: Raven.install docstring is wrong, and I should not have to Raven.install in order to capture exceptions.

Side note: TraceKit reporting needs removed and we should explicitly call into it with our own window.onerror. This is the fundamental reason for Raven.install() and end-users should not have to care about an API that doesnt make any sense here.

dcramer

dcramer commented on Jul 25, 2015

@dcramer
Member

I'm still debugging this, as I was unable to make a test. So far all I know is stackInfo is empty when its parsed.

dcramer

dcramer commented on Jul 25, 2015

@dcramer
Member

I've identified the problem and will get a patch up soon

peterlinnartz

peterlinnartz commented on Aug 25, 2015

@peterlinnartz

@dcramer Thanks for addressing this. Any way we can get a release with this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @dcramer@bfw@peterlinnartz

        Issue actions

          captureMessage works, while captureException does not. · Issue #358 · getsentry/sentry-javascript