{"id":23665919,"url":"https://github.com/matter-in-motion/mm-errors","last_synced_at":"2025-12-08T20:30:13.435Z","repository":{"id":57299106,"uuid":"51879901","full_name":"matter-in-motion/mm-errors","owner":"matter-in-motion","description":"Matter in motion protocol error codes","archived":false,"fork":false,"pushed_at":"2019-09-22T15:53:42.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T10:03:35.049Z","etag":null,"topics":["api","errors","matter-in-motion","mmp","protocol"],"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/matter-in-motion.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-16T23:59:45.000Z","updated_at":"2020-07-30T12:32:54.000Z","dependencies_parsed_at":"2022-08-26T18:02:32.328Z","dependency_job_id":null,"html_url":"https://github.com/matter-in-motion/mm-errors","commit_stats":null,"previous_names":["velocityzen/mmp-errors"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matter-in-motion%2Fmm-errors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matter-in-motion%2Fmm-errors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matter-in-motion%2Fmm-errors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matter-in-motion%2Fmm-errors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matter-in-motion","download_url":"https://codeload.github.com/matter-in-motion/mm-errors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239668614,"owners_count":19677551,"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":["api","errors","matter-in-motion","mmp","protocol"],"created_at":"2024-12-29T06:19:55.199Z","updated_at":"2025-12-08T20:30:13.372Z","avatar_url":"https://github.com/matter-in-motion.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Matter In Motion. Error Codes\n\n[![NPM Version](https://img.shields.io/npm/v/mm-errors.svg?style=flat-square)](https://www.npmjs.com/package/mm-errors)\n[![NPM Downloads](https://img.shields.io/npm/dt/mm-errors.svg?style=flat-square)](https://www.npmjs.com/package/mm-errors)\n\nCommon errors for [Matter in Motion](http://https://github.com/matter-in-motion/mm) protocol\n\n## Errors codes:\n\n* **4000** Call — general error to return\n* **4100** Unauthorized — unauthorized\n* **4104** ProviderNotFound — Auth provider not found\n* **4110** Forbidden — forbidden\n* **4120** NotValidToken — token not valid or expired\n* **4200** RequestValidation — request validation failed\n* **4210** ResponseValidation — response validation failed\n* **4220** RequestTooLarge — request entity too large\n* **4230** RequestEncode — request encode error\n* **4235** RequestDecode — request decode error\n* **4240** ResponseEncode — response encode error\n* **4245** ResponseDecode — response decode error\n* **4250** UnsupportedMedia — unsupported media\n* **4255** NoFilesInRequest — no files found in request\n* **4400** MethodNotFound — method not found\n* **4500** Duplicate — duplicate entity\n* **4540** NotFound — not found\n* **5000** ServerError — server error\n* **5100** NetworkError — network error\n\n## Usage\n```js\nconst errors = require('mm-errors');\n//when you need to return an error:\nreturn errors.NotFound();\n//or\nthrow errors.NotFound();\n```\n\n```js\nreturn error.Call(data, message);\n//or\nthrow error.Call(data, message);\n```\n\nYou can add any data and/or message to errors;\n\n## Custom errors\n```js\nconst errors = require('mm-errors');\nconst CustomError = errors.Error(code, msg, toString);\n\n//and then you can use it\nreturn CustomError();\n//or\nthrow CustomError();\n```\n\n* **code** — error code\n* **message** — default message\n* **toString** — optional toString function\n\n\nLicense: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatter-in-motion%2Fmm-errors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatter-in-motion%2Fmm-errors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatter-in-motion%2Fmm-errors/lists"}