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

@equinor/echo-base

Package Overview
Dependencies
Maintainers
12
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@equinor/echo-base

![logo](https://raw.githubusercontent.com/equinor/EchoCore/main/doc/ee.png)

  • 0.6.9
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
12
Weekly downloads
 
Created
Source

logo

EchoBase

Everything a Echo web need for enabling micro frontend development.

Version Downloads/week License Sisze

@equinor/echo-base @equinor/echo-base @equinor/echo-base

Documentation

What's new

v0.6.0:

  • Fixed error reporting to application insights, it now properly reports all properties including innerErrorsProperties.
  • Fixed baseError, it now properly supports nested innerErrors. Exception/inner Error used to overwrite each others property if they had the same name.
  • BaseError now has errorTraceId, either from backEnd, or a unique frontEnd id
  • BaseError helper methods added for getting properties or propertyByName

It's recommended to create your own error types, extending BaseError, and decorate it with your own fields:

    export class PdfError extends BaseError {
        docNo: string;
        constructor(args: { message: string; docNo: string; innerError?: Error }) {
            super({ name: 'PdfError', message: args.message, innerError: args.innerError });
            this.docNo = args.docNo;
        }
    }

Breaking Changes

v0.6.0:

  • Renamed initializeError to initializeNetworkError and simplified it. It now only takes NetworkErrorArgs as argument.
  • BaseError now properly support nested (and nested-nested) errors with argument innerError.
    Earlier properties with the same name would overwrite each other.
    exception argument renamed to innerError, of type Record<string, unknown> | Error
  • BaseError doesn't add properties directly onto itself anymore, but uses nested errors with argument innerError.
  • Instead of BaseError.allProperties()["someCustomProperty"] use BaseError.findPropertyByName("someCustomProperty"). Since we now use innerError of type Error or Record<string, unknown>, the property has been moved from baseError[property] to baseError.innerError[property].
  • Moved EchoEvents enum to EchoCore.
  • Changed types for EventHub event keys in all functions from string | EchoEvents to string only.

v0.5.0:

  • SubClasses of BaseError will not get the name of the class automatically anymore, but have to specify it. This to avoid name obfuscation/minify to a single letter in appInsight.

Example implementation:

export class CustomError extends BaseError {
    constructor(args: ErrorArgs) {
        super({ ...args, name: 'CustomError' });
    }
}

Keywords

FAQs

Package last updated on 01 Jul 2022

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