Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fetchr

Package Overview
Dependencies
Maintainers
5
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetchr - npm Package Compare versions

Comparing version 0.5.26 to 0.5.27

5

libs/fetcher.client.js

@@ -145,2 +145,7 @@ /**

return result;
}, function(errData) {
if (errData.meta) {
self.options._serviceMeta.push(errData.meta);
}
throw errData;
});

@@ -147,0 +152,0 @@

21

libs/fetcher.js

@@ -209,3 +209,3 @@ /**

this.req = this.options.req || {};
this.serviceMeta = [];
this._serviceMeta = [];

@@ -339,3 +339,10 @@ }

var errResponse = getErrorResponse(err);
res.status(errResponse.statusCode).json(responseFormatter(req, res, errResponse.output));
if (req.query && req.query.returnMeta) {
res.status(errResponse.statusCode).json(responseFormatter(req, res, {
output: errResponse.output,
meta: meta
}));
} else {
res.status(errResponse.statusCode).json(responseFormatter(req, res, errResponse.output));
}
return;

@@ -423,3 +430,3 @@ }

req: this.req,
serviceMeta: this.serviceMeta
serviceMeta: this._serviceMeta
});

@@ -459,3 +466,3 @@ if (1 === arguments.length) {

req: this.req,
serviceMeta: this.serviceMeta
serviceMeta: this._serviceMeta
});

@@ -496,3 +503,3 @@ if (1 === arguments.length) {

req: this.req,
serviceMeta: this.serviceMeta
serviceMeta: this._serviceMeta
});

@@ -532,3 +539,3 @@ if (1 === arguments.length) {

req: this.req,
serviceMeta: this.serviceMeta
serviceMeta: this._serviceMeta
});

@@ -572,3 +579,3 @@ if (1 === arguments.length) {

Fetcher.prototype.getServiceMeta = function () {
return this.serviceMeta;
return this._serviceMeta;
};

@@ -575,0 +582,0 @@

@@ -196,2 +196,6 @@ /**

err.body = errBody || body;
if (err.body) {
err.output = err.body.output;
err.meta = err.body.meta;
}
if (408 === status || 0 === status) {

@@ -198,0 +202,0 @@ err.timeout = options.timeout;

{
"name": "fetchr",
"version": "0.5.26",
"version": "0.5.27",
"description": "Fetchr augments Flux applications by allowing Flux stores to be used on server and client to fetch data",

@@ -43,2 +43,3 @@ "main": "index.js",

"request": "^2.61.0",
"sinon": "^1.17.3",
"supertest": "^1.0.1"

@@ -45,0 +46,0 @@ },

@@ -235,2 +235,15 @@ # Fetchr

And in your service call:
```js
fetcher
.read('someData')
.params({id: ###})
.end(function (err, data, meta) {
if (err) {
// err.output will be { message: "Not found", more: "meta data" }
}
});
```
## XHR Timeouts

@@ -237,0 +250,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc