FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: Flexible Error/Exception handling by vakrilov · Pull Request #5929 · NativeScript/NativeScript · GitHub

feat: Flexible Error/Exception handling - #5929

Merged
vakrilov merged 5 commits into
masterfrom
error-trace
Jun 18, 2018
Merged

vakrilov merged 5 commits into
masterfrom
error-trace

Conversation

vakrilov commented Jun 8, 2018

Copy link
Copy Markdown
Contributor

Implements #5914

ghost assigned vakrilov Jun 8, 2018
ghost added the in progress label Jun 8, 2018
ns-bot added the cla: yes label Jun 8, 2018
vakrilov requested a review from MartoYankov June 13, 2018 05:59
}

// before each
export function tearDown() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Technically, this is executed after each test. There is a setUp() function for before each.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

yup - I want to cache the original ErrorHandler once and clean-up after each test to make sure the test does not leak side effects

Comment thread tests/app/trace/trace-error-tests.ts Outdated
setErrorHandler({
handlerError(error) {
called = true;
TKUnit.assert(error instanceof Error, "trace.error() wrap string in error")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Even if it's fine in this case, I think it's dangerous to use asserts in callbacks. It's better to cache the value and assert it after the assertion of the called variable. In cases where the callbacks are async asserting in them breaks the tests.

Comment thread tns-core-modules/trace/trace.d.ts Outdated
export function write(message: any, category: string, type?: number);

/**
* Passes an error ot the registered ErrorHandler

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

typo - "ot" -> "to"

ghost assigned vchimev Jun 18, 2018
vakrilov merged commit 3dc3a41 into master Jun 18, 2018
ghost removed the in progress label Jun 18, 2018
vakrilov deleted the error-trace branch June 18, 2018 13:37

lock Bot commented Aug 26, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock Bot locked and limited conversation to collaborators Aug 26, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL