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

feat: improve error handling within startCallback and endCallback #3969

Merged
merged 2 commits into from
Oct 24, 2021

Conversation

tehraven
Copy link
Contributor

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

Yes - added a test where a misconfigured devServer option will cause a error to be thrown. This is now caught and handled in the startCallback.

Motivation / Use-Case

The startCallback (and stopCallback) helpers in this version are implementing Promise.then rejected callback param (Promise.then(success, error)), but they aren't actually catching errors that occur in the process of start and stop.

This change makes the util handle errors that occur from start, or downstream from start, making the utility a bit more helpful.

You can also see places in this repo's examples where startCallback expects to see an error and log it to the console, but prior to this change, thrown errors would not be handled nor logged in this way.

Breaking Changes

Additional Info

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 23, 2021

CLA Signed

The committers are authorized under a signed CLA.

@codecov
Copy link

codecov bot commented Oct 24, 2021

Codecov Report

Merging #3969 (74ce319) into master (8f66c22) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3969      +/-   ##
==========================================
+ Coverage   92.58%   92.59%   +0.01%     
==========================================
  Files          14       14              
  Lines        1362     1364       +2     
  Branches      474      474              
==========================================
+ Hits         1261     1263       +2     
  Misses         93       93              
  Partials        8        8              
Impacted Files Coverage Δ
lib/Server.js 93.87% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f66c22...74ce319. Read the comment docs.

@alexander-akait
Copy link
Member

@tehraven Big thanks, release will be on the next week, we need finish #3940

@tehraven tehraven deleted the feat/callback-error-handling branch October 24, 2021 17:34
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.

2 participants