{"id":22096527,"url":"https://github.com/uphold/mali-error-mapper","last_synced_at":"2025-10-05T18:52:41.787Z","repository":{"id":37882256,"uuid":"214457513","full_name":"uphold/mali-error-mapper","owner":"uphold","description":"Mali gRPC error mappers and middleware","archived":false,"fork":false,"pushed_at":"2023-07-18T21:57:16.000Z","size":1907,"stargazers_count":0,"open_issues_count":20,"forks_count":1,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-03-24T00:57:39.220Z","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/uphold.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-11T14:30:36.000Z","updated_at":"2020-07-23T16:44:33.000Z","dependencies_parsed_at":"2025-01-29T07:40:04.831Z","dependency_job_id":null,"html_url":"https://github.com/uphold/mali-error-mapper","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/uphold/mali-error-mapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Fmali-error-mapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Fmali-error-mapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Fmali-error-mapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Fmali-error-mapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uphold","download_url":"https://codeload.github.com/uphold/mali-error-mapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Fmali-error-mapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278503206,"owners_count":25997717,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-01T04:11:30.418Z","updated_at":"2025-10-05T18:52:41.771Z","avatar_url":"https://github.com/uphold.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Mali error mapper\n\nMali gRPC error mappers and middleware.\n\n## Middleware\n\nThis middleware maps all non `GrpcError` errors to a `GrpcError` formatted accordingly.\n\n## Status\n\n[![Build Status](https://travis-ci.com/uphold/mali-error-mapper.svg?branch=master)](https://travis-ci.com/uphold/mali-error-mapper)\n\n## Installation\n\nInstall the package via `yarn`:\n\n```sh\n❯ yarn add mali-error-mapper\n```\n\nor via `npm`:\n\n```sh\n❯ npm install mali-error-mapper --save\n```\n\n## Usage\n\nUsing default mapping:\n\n```javascript\n'use strict';\n\nconst errorMapperMiddleware = require('mali-error-mapper');\nconst app = new Mali();\n\napp.use(errorMapperMiddleware());\n```\n\nUsing custom mappers:\n\n```javascript\n'use strict';\n\nconst errorMapperMiddleware = require('mali-error-mapper');\nconst app = new Mali();\nconst mapper = {\n  map: e =\u003e {\n    if (!(e instanceof MyError)) {\n      return;\n    }\n\n    return {\n      body: {\n        code: 'foo',\n        message: 'bar'\n      },\n      status: 999\n    };\n  };\n};\n\napp.use(errorMiddleware([mapper]));\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuphold%2Fmali-error-mapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuphold%2Fmali-error-mapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuphold%2Fmali-error-mapper/lists"}