Socket
Socket
Sign inDemoInstall

@snapshot-labs/snapshot-sentry

Package Overview
Dependencies
9
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.4.0

3

dist/index.d.ts

@@ -9,2 +9,3 @@ /// <reference types="node" />

export declare function capture(e: any, captureContext?: any): void;
export declare function normalizedCaptureContext(captureContext?: any): any;
export declare function normalizedCaptureContext(e: any, captureContext?: any): any;
export declare function normalizedError(e: any): any;

@@ -26,3 +26,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizedCaptureContext = exports.capture = exports.fallbackLogger = exports.initLogger = exports.sensitiveDataToScrub = exports.scrubData = void 0;
exports.normalizedError = exports.normalizedCaptureContext = exports.capture = exports.fallbackLogger = exports.initLogger = exports.sensitiveDataToScrub = exports.scrubData = void 0;
const Sentry = __importStar(require("@sentry/node"));

@@ -109,7 +109,7 @@ const DEFAULT_TRACE_SAMPLE_RATE = '0.01';

}
Sentry.captureException(e, normalizedCaptureContext(captureContext));
Sentry.captureException(normalizedError(e), normalizedCaptureContext(e, captureContext));
}
exports.capture = capture;
function normalizedCaptureContext(captureContext) {
if (!captureContext) {
function normalizedCaptureContext(e, captureContext) {
if (!captureContext && !isJsonRpcError(e)) {
return;

@@ -128,4 +128,20 @@ }

}
if (isJsonRpcError(e)) {
_captureContext.contexts.jsonRpcError = e;
}
return _captureContext;
}
exports.normalizedCaptureContext = normalizedCaptureContext;
function normalizedError(e) {
if (isJsonRpcError(e)) {
return new Error(e.message);
}
else if (typeof e === 'string') {
return new Error(e);
}
return e;
}
exports.normalizedError = normalizedError;
function isJsonRpcError(e) {
return e.hasOwnProperty('code') && e.hasOwnProperty('message') && e.hasOwnProperty('data');
}
{
"name": "@snapshot-labs/snapshot-sentry",
"version": "1.3.0",
"version": "1.4.0",
"license": "MIT",

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

@@ -100,7 +100,7 @@ import * as Sentry from '@sentry/node';

Sentry.captureException(e, normalizedCaptureContext(captureContext));
Sentry.captureException(normalizedError(e), normalizedCaptureContext(e, captureContext));
}
export function normalizedCaptureContext(captureContext?: any) {
if (!captureContext) {
export function normalizedCaptureContext(e: any, captureContext?: any) {
if (!captureContext && !isJsonRpcError(e)) {
return;

@@ -123,3 +123,21 @@ }

if (isJsonRpcError(e)) {
_captureContext.contexts.jsonRpcError = e;
}
return _captureContext;
}
export function normalizedError(e: any) {
if (isJsonRpcError(e)) {
return new Error(e.message);
} else if (typeof e === 'string') {
return new Error(e);
}
return e;
}
function isJsonRpcError(e: any) {
return e.hasOwnProperty('code') && e.hasOwnProperty('message') && e.hasOwnProperty('data');
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc