Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include "nativeStack" key for native exceptions, include unit-test #2

Open
wants to merge 3 commits into
base: TIMOB-26007
Choose a base branch
from

Conversation

hansemannn
Copy link

As per discussion in tidev#10022. We may want to change the unit-tests here as well, but need to adjust the message checks.

@hansemannn hansemannn changed the title Include "nativeReason" key for native exceptions Include "nativeStack" key for native exceptions, include unit-test May 24, 2018
ex.should.have.readOnlyProperty('stack').which.is.a.String;
// has special "nativeStack" property for native stacktrace
// TODO: Should we make this an array instead?
ex.should.have.property('nativeStack').which.is.a.String;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make this array to make it easier to format to string on crash dialog. On Windows I am implementing it that way.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having it look/feel similar to the standard stack property makes sense though too.
I understand that an array would be easier to loop through and would avoid EOL differences, but originally I think the goal was to have a native equivalent of the js stack property which is a string (and on V8/Android actually has the type of Error and message prefixed ahead of the actual stacktrace)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question really is how developers use it in production, and I think a common use-case is logging it to the console (if even used), so a String might be more convenient as well. But I understand @infosia that it feels "wrong" from a structural perspective.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok makes sense, considering to align with stack property, I'm ok with string.

garymathews pushed a commit that referenced this pull request Jul 17, 2018
garymathews pushed a commit that referenced this pull request Sep 9, 2019
* refactor: fix all warnings (except deprecations for now)

* refactor: update Swift test module to Swift 5

* refactor: update Swift test module to Swift 5 #2

* refactor: update Swift module template to Swift 5

* fix: properly lint hooks, restore app.js

* fix: fix eslint warnings

* fix: fix eslint

* fix linting issue

* remove duplicate 'use strict' directive

* remove duplicate hasProperty method declaration

* fix: address couple more warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants