New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

redact-axios-error

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redact-axios-error

grooms and redacts axios errors to trim them down and make the more useful for logging

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29
decreased by-12.12%
Maintainers
1
Weekly downloads
 
Created
Source

redact-axios-error

Axios errors are verbose when strigified and leak URL and header authorization.

This library trims them down to essential information removing circular references. It redacts URL and header authorization. It can optionally be configured to redact any of request, response, and query string data.

Requirements

Node 8+

Getting started

npm i -S redact-axios-error

Usage

const groomer = new AxiosErrorGroomer()
log.error(groomer.getGroomedAxiosError(err), 'Some error message')

OR

log.error(new AxiosErrorGroomer().getGroomedAxiosError(err), 'Some error message')

OR

To redact request, response, and query string data:
log.error(new AxiosErrorGroomer(true, true, true).getGroomedAxiosError(err), 'Some error message')

Methods

  • AxiosErrorGroomer (includeRequestData = true, includeResponseData = true, includeQueryData = true) - constructor, defaults to NOT redact request, response, and query string data
  • getGroomedAxiosError(error) - trims and redacts if AxiosError, otherwise returns the Error unaltered
  • isAxiosError(error) - true if the Error is an Axios error, called by the getGroomedAxiosError method
  • includeRequestData(bool) - initializes kafka, connecting to broker, returns promise, but should not await if utilizing fallback, return this for chaining
  • includeResponseData(bool) - closes the kafka connection, returns promise, return this for chaining
  • includeQueryData(bool) - queue a message for publishing to kafka, the defaultTopic will be used unless topic is provided, return this for chaining

Keywords

FAQs

Package last updated on 18 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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