Skip to content

Simplify the wrapReason helper function #14607

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

Merged
merged 1 commit into from
Feb 26, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

All call-sites that use wrapReason should be passing a (possibly cloned) Error to the helper function, hence we shouldn't need to have a fallback code-path for any other data.
Note that for the cancel/error methods on Streams, since PR #11115 we've been asserting that the argument is in fact an Error as intended.
When calling wrapReason from rejected Promises, we should also be guaranteed that an Error is provided thanks to the ESLint rules no-throw-literal and prefer-promise-reject-errors.

All call-sites that use `wrapReason` should be passing a (possibly cloned) `Error` to the helper function, hence we shouldn't need to have a fallback code-path for any other data.
Note that for the `cancel`/`error` methods on Streams, since PR 11115 we've been asserting that the argument is in fact an `Error` as intended.
When calling `wrapReason` from *rejected* Promises, we should also be guaranteed that an `Error` is provided thanks to the ESLint rules `no-throw-literal` and `prefer-promise-reject-errors`.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/ec32a79d43c1c9f/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/63d6a3169815156/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/ec32a79d43c1c9f/output.txt

Total script time: 23.49 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 11
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/ec32a79d43c1c9f/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/63d6a3169815156/output.txt

Total script time: 26.07 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: Passed

@timvandermeij timvandermeij merged commit f782f5e into mozilla:master Feb 26, 2022
@timvandermeij
Copy link
Contributor

Looks good!

@Snuffleupagus Snuffleupagus deleted the wrapReason-unreachable branch February 26, 2022 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants