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

sentry-api

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sentry-api - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

8

docs/data.json

@@ -309,3 +309,3 @@ {

"file": "lib/client.js",
"line": 141,
"line": 149,
"description": "Convenience method for making GET requests.",

@@ -339,3 +339,3 @@ "itemtype": "method",

"file": "lib/client.js",
"line": 154,
"line": 162,
"description": "Convenience method for making POST requests.",

@@ -369,3 +369,3 @@ "itemtype": "method",

"file": "lib/client.js",
"line": 167,
"line": 175,
"description": "Convenience method for making DELETE requests.",

@@ -394,3 +394,3 @@ "itemtype": "method",

"file": "lib/client.js",
"line": 179,
"line": 187,
"description": "Convenience method for making PUT requests.",

@@ -397,0 +397,0 @@ "itemtype": "method",

@@ -133,3 +133,11 @@ var fs = require('fs');

this.logger.warn(response.statusCode, response.statusMessage);
error = new Error(util.format('%d: %s', response.statusCode, response.statusMessage));
if (body && body.detail) {
error = new Error(body.detail);
}
else if (response.statusMessage) {
error = new Error(util.format('%d: %s', response.statusCode, response.statusMessage));
}
else {
error = new Error(response.statusCode);
}
callback(error);

@@ -136,0 +144,0 @@ reject(error)

{
"name": "sentry-api",
"version": "0.0.3",
"version": "0.0.4",
"description": "A client for the Sentry API",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -37,2 +37,34 @@ var request = require('request');

exports.testError = function(test) {
test.expect(2);
var request = nock('https://host.com')
.get('/api/0/path')
.reply(400);
var client = new Client('https://PUBLIC:SECRET@host.com/123');
client.request('path', {}, function(error, response) {
test.ok(request.isDone(), 'Should make the correct request.');
test.equal(error.message, '400', 'Should return the error.');
test.done();
});
};
exports.testJsonError = function(test) {
test.expect(2);
var request = nock('https://host.com')
.get('/api/0/path')
.reply(400, {detail: 'bar'});
var client = new Client('https://PUBLIC:SECRET@host.com/123');
client.request('path', {}, function(error, response) {
test.ok(request.isDone(), 'Should make the correct request.');
test.equal(error.message, 'bar', 'Should parse the error json.');
test.done();
});
};
exports.testGet = function(test) {

@@ -39,0 +71,0 @@ test.expect(2);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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