-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
cleanupThis doesn't seem right, refactor, etcThis doesn't seem right, refactor, etclibraryFor librariesFor librarieslinkedin-toolFor the LinkedIn Tool userscriptFor the LinkedIn Tool userscript
Description
Inheriting from Error does NOT update the name property, so new exceptions will show the wrong name. Overriding to use this.constructor.name is common.
Currently, all of our custom ones override the constructor, but providing a get name() works as well. We should do that, and update all modules to use it for module level exceptions.
The xunit library has a special case inside TestCase that could be move away from the ctor to a getter as well.
- Implement and export
- Update main modules to use newer version of base.
- Update various modules to use this instead of each having their own custom
- Update xunit's special case
- Update main modules to use newest versions of all libraries and new class name
- Retire old class name from various libraries
Starting state:
$ grep extends.Error **/*.js
lib/userscript.js: class UserscriptError extends Error {
lib/widget.js: class WidgetError extends Error {
lib/xunit.js: static Error = class extends Error {
linkedin-tool.user.js: static Error = class extends Error {Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
cleanupThis doesn't seem right, refactor, etcThis doesn't seem right, refactor, etclibraryFor librariesFor librarieslinkedin-toolFor the LinkedIn Tool userscriptFor the LinkedIn Tool userscript