{"id":13670529,"url":"https://github.com/bjyoungblood/es6-error","last_synced_at":"2025-04-08T08:14:58.285Z","repository":{"id":29511259,"uuid":"33049543","full_name":"bjyoungblood/es6-error","owner":"bjyoungblood","description":"Easily-extendable error for use with ES6 classes","archived":false,"fork":false,"pushed_at":"2020-12-11T09:34:19.000Z","size":52,"stargazers_count":213,"open_issues_count":6,"forks_count":34,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T13:03:12.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bjyoungblood.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-28T20:43:06.000Z","updated_at":"2024-10-25T10:27:27.000Z","dependencies_parsed_at":"2022-08-09T20:40:12.054Z","dependency_job_id":null,"html_url":"https://github.com/bjyoungblood/es6-error","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjyoungblood%2Fes6-error","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjyoungblood%2Fes6-error/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjyoungblood%2Fes6-error/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjyoungblood%2Fes6-error/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bjyoungblood","download_url":"https://codeload.github.com/bjyoungblood/es6-error/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247451639,"owners_count":20940939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T09:00:44.432Z","updated_at":"2025-04-08T08:14:58.264Z","avatar_url":"https://github.com/bjyoungblood.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# es6-error\n\n[![npm version](https://badge.fury.io/js/es6-error.svg)](https://www.npmjs.com/package/es6-error)\n[![Build Status](https://travis-ci.org/bjyoungblood/es6-error.svg?branch=master)](https://travis-ci.org/bjyoungblood/es6-error)\n\nAn easily-extendable error class for use with ES6 classes (or ES5, if you so\nchoose).\n\nTested in Node 4.0, Chrome, and Firefox.\n\n## Why?\n\nI made this because I wanted to be able to extend Error for inheritance and type\nchecking, but can never remember to add\n`Error.captureStackTrace(this, this.constructor.name)` to the constructor or how\nto get the proper name to print from `console.log`.\n\n## ES6 Usage\n\n```javascript\n\nimport ExtendableError from 'es6-error';\n\nclass MyError extends ExtendableError {\n  // constructor is optional; you should omit it if you just want a custom error\n  // type for inheritance and type checking\n  constructor(message = 'Default message') {\n    super(message);\n  }\n}\n\nexport default MyError;\n```\n\n## ES5 Usage\n\n```javascript\n\nvar util = require('util');\nvar ExtendableError = require('es6-error');\n\nfunction MyError(message) {\n  message = message || 'Default message';\n  ExtendableError.call(this, message);\n}\n\nutil.inherits(MyError, ExtendableError);\n\nmodule.exports = MyError;\n```\n\n### Known Issues\n\n- Uglification can obscure error class names ([#31](https://github.com/bjyoungblood/es6-error/issues/31#issuecomment-301128220))\n\n#### Todo\n\n- Better browser compatibility\n- Browser tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjyoungblood%2Fes6-error","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjyoungblood%2Fes6-error","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjyoungblood%2Fes6-error/lists"}