configcat / node-sdk

ConfigCat SDK for Node.js. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
https://configcat.com/docs/sdk-reference/node
MIT License
19 stars 7 forks source link

Better handling of failed config requests #24

Closed kroleg closed 3 years ago

kroleg commented 3 years ago

show useful error message if there is no response from configcat api

Describe the purpose of your pull request

If developer has some issues with networking (in my case it was nodejs not picking up root cert) then returned error (because response is empty) is "Status: undefined - undefined" which is not very useful

Related issues (only if applicable)

Provide links to issues relating to this pull request

Requirement checklist (only if applicable)

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

endret commented 3 years ago

Dear @kroleg ,

Thank you for your pull request. It looks fine and we can merge it, but despite that your changes is tiny you have to accept our contribution agreement in the PR description.

Regards Endre

kroleg commented 3 years ago

@endret thanks. I've accepted contribution agreement

codecov[bot] commented 3 years ago

Codecov Report

Merging #24 (efd8ac2) into master (8738dd8) will decrease coverage by 7.08%. The diff coverage is 75.00%.

:exclamation: Current head efd8ac2 differs from pull request most recent head 7d2e009. Consider uploading reports for the commit 7d2e009 to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master      #24      +/-   ##
==========================================
- Coverage   77.08%   70.00%   -7.09%     
==========================================
  Files           2        2              
  Lines          48       40       -8     
  Branches        8        9       +1     
==========================================
- Hits           37       28       -9     
- Misses         11       12       +1     
Impacted Files Coverage Δ
src/config-fetcher.ts 65.71% <75.00%> (+0.08%) :arrow_up:
src/client.ts 100.00% <0.00%> (ø)

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 8738dd8...7d2e009. Read the comment docs.