Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
fetch-reject
Advanced tools
A simple wrapper for fetch which rejects on HTTP error
Normal fetch
does not throw on HTTP error (non-200 status code). This wrapper allows it to do so.
$ npm install --save fetch-reject;
import fetch from 'fetch-reject';
// use just like normal fetch
fetch('http://httpstat.us/500')
.then(date => doSomething(data));
.catch(err => {
console.log(err) // -> 'GET ... 500 (Internal Server Error)'
console.log(err.status) // -> 500
})
See the fetch
docs for more.
Same as normal fetch
, but it rejects with an Error
object on non-200.
Type: Error
Will be reject
-ed on non-200 response. An error object containing the statusText
of the response. Has a status
field which is equal to response.status
;
Returns a fetch
function similar to the one documented above, but using the provided originFetch
function. Can be used to enhance polyfills.
Type: function
A function that complies with the original fetch
spec. Will be used instead of window.fetch
internally
Type: function
A function that acts similarly to fetch
(detailed above), but uses the provided originFetch
function instead.
FAQs
A simple wrapper for fetch which rejects on HTTP error
We found that fetch-reject demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.