{"id":16223416,"url":"https://github.com/so1ve/oak-json-error","last_synced_at":"2026-05-12T07:41:10.969Z","repository":{"id":62422418,"uuid":"436984054","full_name":"so1ve/oak-json-error","owner":"so1ve","description":"Oak middleware JSON error","archived":false,"fork":false,"pushed_at":"2024-02-01T17:49:13.000Z","size":7,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T06:46:25.802Z","etag":null,"topics":["deno","javascript","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/so1ve.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://afdian.net/@so1ve"]}},"created_at":"2021-12-10T13:12:27.000Z","updated_at":"2023-07-21T09:23:14.000Z","dependencies_parsed_at":"2024-11-04T00:23:14.837Z","dependency_job_id":"62bcb6f2-09b2-4946-8611-bfdb20404c1a","html_url":"https://github.com/so1ve/oak-json-error","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so1ve%2Foak-json-error","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so1ve%2Foak-json-error/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so1ve%2Foak-json-error/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so1ve%2Foak-json-error/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/so1ve","download_url":"https://codeload.github.com/so1ve/oak-json-error/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761031,"owners_count":20991533,"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":["deno","javascript","typescript"],"created_at":"2024-10-10T12:18:47.002Z","updated_at":"2026-05-12T07:41:09.036Z","avatar_url":"https://github.com/so1ve.png","language":"TypeScript","funding_links":["https://afdian.net/@so1ve"],"categories":[],"sub_categories":[],"readme":"# oak_json_error\n\nThe oak version of [koa-json-error](https://github.com/koajs/json-error).\n\n## Usage\n\n```ts\nimport { jsonErrorMiddleware } from \"https://deno.land/x/oak_json_error/mod.ts\";\n\nconst errorHandler = jsonErrorMiddleware();\napp.use(errorHandler);\n// ... Your code here ...\n// app.use(route.routes())\n```\n\n## Customize\n\n### Options\n\n`format`: `\u003cT extends Error\u003e(err: T) =\u003e any;`\n\n```ts\nconst errorHandler = jsonErrorMiddleware({ // If the error is thrown by ctx.throw, it will have status\n  format: (err: Error \u0026 { status: number }) =\u003e {\n    return {\n      code: err.status,\n      message: err.message,\n      error: err.message,\n    };\n  },\n});\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fso1ve%2Foak-json-error","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fso1ve%2Foak-json-error","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fso1ve%2Foak-json-error/lists"}