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

wadl-client

Package Overview
Dependencies
Maintainers
3
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wadl-client - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

bower.json
{
"name": "wadl-client",
"main": "wadl-client.js",
"version": "1.0.2",
"version": "1.0.3",
"homepage": "https://github.com/rbelouin/wadl-client",

@@ -6,0 +6,0 @@ "authors": [

{
"name": "wadl-client",
"version": "1.0.2",
"version": "1.0.3",
"description": "Generate a Javascript client for a web API providing a WADL description",

@@ -5,0 +5,0 @@ "main": "wadl-client.js",

@@ -218,2 +218,11 @@ var swagger = {

}
},
"/test/catch": {
"get": {
"responses": {
"default": {
"description": "catch"
}
}
}
}

@@ -220,0 +229,0 @@ }

@@ -127,2 +127,6 @@ var http = require("http");

app.get("/test/catch", function(req, res) {
res.send();
});
var server;

@@ -129,0 +133,0 @@

@@ -260,2 +260,25 @@ var swagger = swagger || require("./swagger.js");

});
it("must not catch an error that is thrown in an onValue callback", function(done) {
if(typeof window != "undefined") {
console.log("This test is not compliant with browser environments");
done();
}
else {
var req = client.test.catch.get().send();
var d = require("domain").create();
d.on("error", function(error) {
expect(error.message).toBe("UNCAUGHT ERROR");
done();
});
d.run(function() {
req.onValue(function() {
throw new Error("UNCAUGHT ERROR");
});
});
}
});
});

@@ -97,17 +97,20 @@ var WadlClient = (function() {

var req = request(options, function(error, response, body) {
var parseResult;
try {
if(error) {
Utils.logError(options.logger, error);
Utils.send(sink, new B.Error(error));
parseResult = new B.Error(error);
}
else if(response.statusCode >= 200 && response.statusCode < 300) {
Utils.send(sink, options.parse ? Utils.parseBody(response, body) : body);
parseResult = options.parse ? Utils.parseBody(response, body) : body;
}
else {
Utils.send(sink, new B.Error(options.parse ? Utils.parseBody(response, body) : body));
parseResult = new B.Error(options.parse ? Utils.parseBody(response, body) : body);
}
} catch(e) {
Utils.logError(options.logger, "An error occured while parsing: " + body);
Utils.send(sink, new B.Error(e));
parseResult = new B.Error(e);
}
Utils.send(sink, parseResult);
});

@@ -114,0 +117,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