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

@beforeyoubid/error-adapter

Package Overview
Dependencies
Maintainers
8
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beforeyoubid/error-adapter - npm Package Compare versions

Comparing version 1.0.20 to 1.0.21

2

package.json
{
"name": "@beforeyoubid/error-adapter",
"version": "1.0.20",
"version": "1.0.21",
"description": "A module to standardize error handling across the BYB platform",

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

@@ -70,9 +70,9 @@ # BYB Error Adapter

# Usages
The module caters to the following usage mechanisms:
1. Using `withSentry` higher-order function.
The module caters for the following usage mechanisms:
- Using `withSentry` higher-order function.
- This can be used in confuction with the `formatErrors` function (see below).
- Used to wrap a Lambda handler to capture exceptions as per the `serverless-sentry-lib` library.
2. Using `formatErrors` function to format and capture errors caught by GraphQL.
- Using `formatErrors` function to format and capture errors caught by GraphQL.
- This can be passed into a GraphQL handler function to format and send errors to Sentry.
3. Using `handleErrorSentryOptions` to apply the above rules to your own `Sentry` client.
- Using `handleErrorSentryOptions` to apply the above rules to your own `Sentry` client.
### 1) Using withSentry higher-order function

@@ -92,2 +92,3 @@ **Original Lambda Handler Code**:

import { withSentry } from "@beforeyoubid/error-adapter"; // This helper library
export const handler = withSentry(async (event, context) => {

@@ -103,5 +104,4 @@ console.log("EVENT: \n" + JSON.stringify(event, null, 2));

import { ApolloServer } from 'apollo-server-lambda';
import withSentry from 'serverless-sentry-lib';
import schema from '../graphql';
import { formatError } from '@beforeyoubid/error-adapter';
import { formatError, withSentry } from '@beforeyoubid/error-adapter';

@@ -187,3 +187,3 @@ const server = new ApolloServer({

import withSentry from 'serverless-sentry-lib';
import { handleErrorSentryOptions, NotFound } from '@beforeyoubid/error-adapter';
import { handleErrorSentryOptions NotFound } from '@beforeyoubid/error-adapter';

@@ -190,0 +190,0 @@ export const cronHandler = withSentry(handleErrorSentryOptions, async (event, context) => {

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