Omit the stack trace for user errors.#7480
Merged
jridgewell merged 1 commit intoampproject:masterfrom Feb 21, 2017
Merged
Conversation
jridgewell
approved these changes
Feb 11, 2017
src/error.js
Outdated
| } | ||
| } | ||
|
|
||
| const messageIsUserErrorMessage = isUserErrorMessage(message); |
jridgewell
requested changes
Feb 11, 2017
Contributor
jridgewell
left a comment
There was a problem hiding this comment.
Whoops, need to update tests.
37e2a97 to
03dcff9
Compare
Contributor
Author
|
Thanks for catching that! PTAL |
Contributor
|
Still no tests... |
03dcff9 to
8269373
Compare
Contributor
Author
|
Oh thanks I see, I've added tests to specifically verify user errors exclude the stack. PTAL |
jridgewell
requested changes
Feb 15, 2017
test/functional/test-error.js
Outdated
| }); | ||
|
|
||
| it('should omit the error stack for user errors', () => { | ||
| const log = new Log(window, () => LogLevel.FINE, USER_ERROR_SENTINEL); |
Contributor
There was a problem hiding this comment.
The loggers may already be installed?
test/functional/test-error.js
Outdated
| it('should omit the error stack for user errors', () => { | ||
| const log = new Log(window, () => LogLevel.FINE, USER_ERROR_SENTINEL); | ||
| try { | ||
| log.assert(false, '123'); |
Contributor
There was a problem hiding this comment.
log.createError('123');. That'll allow you to get rid of the try-catch.
test/functional/test-error.js
Outdated
| getErrorReportUrl(undefined, undefined, undefined, undefined, e, | ||
| true)); | ||
| const query = parseQueryString(url.search); | ||
| expect(query.s).to.not.equal(e.stack); |
Contributor
There was a problem hiding this comment.
Unnecessary because of the following expect.
8269373 to
acb8ad0
Compare
Contributor
Author
|
Oh nice, thanks. This looks much cleaner |
jridgewell
approved these changes
Feb 15, 2017
test/functional/test-error.js
Outdated
| import {parseUrl, parseQueryString} from '../../src/url'; | ||
| import {user} from '../../src/log'; | ||
| import { | ||
| Log, |
acb8ad0 to
ee8d96b
Compare
Contributor
Author
|
I don't have authorization to merge to master at this time. If we want this merged, someone other than me will have to pull the trigger. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #4949