Giter Site home page Giter Site logo

make-error's People

Contributors

alchar avatar greenkeeper[bot] avatar greenkeeperio-bot avatar honzajavorek avatar idchlife avatar julien-f avatar unional avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

make-error's Issues

Consider making properties enumerable

I saw that stack, message, and name were not enumerable while trying to serialize a BaseError using JSON.stringify.

Was this a purposeful decision to match the weird behavior of error?

Subclassing a custom error class breaks name, instanceof flow in TypeScript

Hey there, thanks for maintaining this great package!

I'm using the ES6 version with TypeScript (also targetting ES6). Everything works as documented until I subclass a custom error, in which case only the custom error superclass's name comes through, and InstanceOf no longer works as well.

import { BaseError } from 'make-error';


class CustomBaseError extends BaseError {
}

class CustomError extends CustomBaseError {
}

const err = new CustomError();
console.log(err instanceof CustomError); // false
console.log(err instanceof CustomBaseError); // true
console.log(err instanceof BaseError); // true

console.log(err.name); // 'CustomBaseError'

Is this expected behavior/ perhaps just a TypeScript issue?

I've found a decent blog post which describes how to handle it in the Best Practice – Be Specific with Errors section, though unfortunately the official link to the TS docs is broken.

Nested errors

Not sure if you want to link this, but I wrote https://www.npmjs.com/package/make-error-cause which wraps make-error with a second argument to specify a cause (useful for nesting errors for better error messaging). I'm using it, for example, Unable to parse "..."\nCaused by: Unexpected token.

Testsuite 1.3.6 : failures with nodejs 12.19.0 and jest 26.6.3

I just unpacked the 1.3.6 tarball, went in, ran jest, and there were four failures:

  • makeError(name) › derivable with › makeError(constructor)
  • makeError(name) › derivable with › ES5 inheritance
  • ES6 inheritance › derivable with › makeError(constructor)
  • ES6 inheritance › derivable with › ES5 inheritance

The first two give Expected: "something" Received: "Error" ; the last two TypeError: Class constructor cannot be invoked without 'new'.

Consider making constructor writable

It's a minor issue and it's completely reasonable if you wish to close this, but I run into a TypeError issue when running under 'use strict' - more information in TypeScript since it's technically an issue there and not here: microsoft/TypeScript#6887. Basically, assignment to this property throw a TypeError under 'use strict' because it takes shadowing into account even though it's a different object (just a part of the prototype).

An in-range update of uglify-js is breaking the build 🚨

Version 2.8.2 of uglify-js just got published.

Branch Build failing 🚨
Dependency uglify-js
Current Version 2.8.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As uglify-js is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 3 commits .

  • fb2b6c7 v2.8.2
  • f5cbe19 invert reduce_vars tracking flag (#1519)
  • b34fa11 fix evaluate on object getter & setter (#1515)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Attempted to assign to readonly property error

Description of the issue: When invoking the getter of an errors stack property - this causes the property to be redefined and doesn't explicitly set the writable property back to true. On certain browsers (tested on iOS Safari - though it works fine on Desktop Chrome) this results in an Attempted to assign to read-only property unhandled exception to be thrown.

I've put together a little test project to demonstrate the issue, it can be found here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.