{"id":16439611,"url":"https://github.com/sevenoutman/axios-error-handler","last_synced_at":"2025-02-25T22:28:23.224Z","repository":{"id":77177379,"uuid":"466753014","full_name":"SevenOutman/axios-error-handler","owner":"SevenOutman","description":null,"archived":false,"fork":false,"pushed_at":"2022-03-25T10:01:30.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-08T11:23:47.088Z","etag":null,"topics":["axios"],"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/SevenOutman.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}},"created_at":"2022-03-06T13:57:51.000Z","updated_at":"2023-03-09T00:48:44.000Z","dependencies_parsed_at":"2023-09-04T10:15:57.870Z","dependency_job_id":null,"html_url":"https://github.com/SevenOutman/axios-error-handler","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":"egoist/ts-lib-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SevenOutman%2Faxios-error-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SevenOutman%2Faxios-error-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SevenOutman%2Faxios-error-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SevenOutman%2Faxios-error-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SevenOutman","download_url":"https://codeload.github.com/SevenOutman/axios-error-handler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240757779,"owners_count":19852819,"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":["axios"],"created_at":"2024-10-11T09:09:55.052Z","updated_at":"2025-02-25T22:28:23.174Z","avatar_url":"https://github.com/SevenOutman.png","language":"TypeScript","funding_links":["https://github.com/sponsors/SevenOutman"],"categories":[],"sub_categories":[],"readme":"# axios-error-handler\n\nThe utilities for error handling with axios.\n\n[![npm version](https://badgen.net/npm/v/axios-error-handler)](https://npm.im/axios-error-handler) [![npm downloads](https://badgen.net/npm/dm/axios-error-handler)](https://npm.im/axios-error-handler)\n\n## Features:\n\n- Define error handlers based on response status code\n- Wildcards mathching a class of status codes\n\n## Install\n\n```bash\nnpm i axios-error-handler\n```\n\n## Usage\n\n```ts\nimport { createErrorHandler } from \"axios-error-handler\"\n\naxios.interceptors.response.use(\n  null,\n  createErrorHandler({\n    // Runs this callback if thrown.response.status is 401\n    401(thrown) {\n      alert(\"\")\n    },\n    // Runs this callback if thrown.response.status is 5xx\n    \"5xx\"(thrown) {\n      alert(\"\")\n    },\n  }),\n)\n```\n\n## Sponsors\n\n[![sponsors](https://sponsors-images.SevenOutman.sh/sponsors.svg)](https://github.com/sponsors/SevenOutman)\n\n## License\n\nMIT \u0026copy; [SevenOutman](https://github.com/sponsors/SevenOutman)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevenoutman%2Faxios-error-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsevenoutman%2Faxios-error-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevenoutman%2Faxios-error-handler/lists"}