{"id":13705695,"url":"https://github.com/HashLoad/handle-exception","last_synced_at":"2025-05-05T16:33:42.204Z","repository":{"id":43752574,"uuid":"206130403","full_name":"HashLoad/handle-exception","owner":"HashLoad","description":"Middleware for handle exception in HORSE","archived":false,"fork":false,"pushed_at":"2023-12-28T13:51:21.000Z","size":93,"stargazers_count":36,"open_issues_count":1,"forks_count":16,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-04-14T00:32:21.910Z","etag":null,"topics":["exceptions","handler","horse","middleware"],"latest_commit_sha":null,"homepage":"","language":"Pascal","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/HashLoad.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}},"created_at":"2019-09-03T17:09:07.000Z","updated_at":"2024-01-20T15:16:26.000Z","dependencies_parsed_at":"2023-12-30T06:31:42.431Z","dependency_job_id":"94f5be41-80b5-43c9-b8ff-e15cb2cecc1e","html_url":"https://github.com/HashLoad/handle-exception","commit_stats":{"total_commits":37,"total_committers":11,"mean_commits":"3.3636363636363638","dds":"0.43243243243243246","last_synced_commit":"778a38e50572664f65bb9770d8d7ae52a840e74e"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhandle-exception","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhandle-exception/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhandle-exception/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhandle-exception/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HashLoad","download_url":"https://codeload.github.com/HashLoad/handle-exception/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223555740,"owners_count":17164619,"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":["exceptions","handler","horse","middleware"],"created_at":"2024-08-02T22:00:46.254Z","updated_at":"2024-11-13T13:30:48.512Z","avatar_url":"https://github.com/HashLoad.png","language":"Pascal","readme":"# handle-exception\n\u003cb\u003eHandle-exception\u003c/b\u003e is a official middleware for handling exceptions in APIs developed with the \u003ca href=\"https://github.com/HashLoad/horse\"\u003eHorse\u003c/a\u003e framework.\n\u003cbr\u003eWe created a channel on Telegram for questions and support:\u003cbr\u003e\u003cbr\u003e\n\u003ca href=\"https://t.me/hashload\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/telegram-join%20channel-7289DA?style=flat-square\"\u003e\n\u003c/a\u003e\n\n## ⭕ Prerequisites\n[**jhonson**](https://github.com/HashLoad/jhonson) - Jhonson is a official middleware for working with JSON in APIs developed with the Horse framework.\n\n*Obs: If you use Boss (dependency manager for Delphi), the jhonson will be installed automatically when installing handle-exception.*\n\n## ⚙️ Installation\nInstallation is done using the [`boss install`](https://github.com/HashLoad/boss) command:\n``` sh\nboss install handle-exception\n```\nIf you choose to install manually, simply add the following folders to your project, in *Project \u003e Options \u003e Resource Compiler \u003e Directories and Conditionals \u003e Include file search path*\n```\n../handle-exception/src\n```\n\n## ✔️ Compatibility\nThis middleware is compatible with projects developed in:\n- [X] Delphi\n- [X] Lazarus\n\n## ⚡️ Quickstart Delphi\n```delphi\nuses \n  Horse, \n  Horse.Jhonson, // It's necessary to use the unit\n  Horse.HandleException, // It's necessary to use the unit\n  System.JSON;\n\nbegin\n  // It's necessary to add the middlewares in the Horse:\n  THorse\n    .Use(Jhonson) // It has to be before the exceptions middleware\n    .Use(HandleException);\n\n  THorse.Post('/ping',\n    procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)\n    begin\n      // Manage your exceptions:\n      raise EHorseException.New.Error('My Error!');\n    end);\n\n  THorse.Listen(9000);\nend;\n```\n\n## ⚡️ Quickstart Lazarus\n```delphi\n{$MODE DELPHI}{$H+}\n\nuses\n  {$IFDEF UNIX}{$IFDEF UseCThreads}\n  cthreads,\n  {$ENDIF}{$ENDIF}\n  Horse,\n  Horse.Jhonson, // It's necessary to use the unit\n  Horse.HandleException, // It's necessary to use the unit\n  SysUtils;\n\nprocedure GetPing(Req: THorseRequest; Res: THorseResponse; Next: TNextProc);\nbegin\n  // Manage your exceptions:\n  raise EHorseException.New.Error('My Error!');\nend;\n\nbegin\n  // It's necessary to add the middlewares in the Horse:\n  THorse\n    .Use(Jhonson) // It has to be before the exceptions middleware\n    .Use(HandleException);\n\n  THorse.Get('/ping', GetPing);\n\n  THorse.Listen(9000);\nend.\n```\n\n## ⚠️ License\n`handle-exception` is free and open-source middleware licensed under the [MIT License](https://github.com/HashLoad/handle-exception/blob/master/LICENSE).\n","funding_links":[],"categories":["Network"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHashLoad%2Fhandle-exception","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHashLoad%2Fhandle-exception","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHashLoad%2Fhandle-exception/lists"}