{"id":22989493,"url":"https://github.com/roxasshadow/sinatra-error","last_synced_at":"2025-04-02T11:45:07.956Z","repository":{"id":2468291,"uuid":"3440713","full_name":"RoxasShadow/sinatra-error","owner":"RoxasShadow","description":"Error handling in Sinatra like Grape","archived":false,"fork":false,"pushed_at":"2013-12-18T01:39:22.000Z","size":100,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T02:45:01.157Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RoxasShadow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-14T14:57:43.000Z","updated_at":"2013-12-18T01:39:24.000Z","dependencies_parsed_at":"2022-08-25T14:01:54.026Z","dependency_job_id":null,"html_url":"https://github.com/RoxasShadow/sinatra-error","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoxasShadow%2Fsinatra-error","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoxasShadow%2Fsinatra-error/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoxasShadow%2Fsinatra-error/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoxasShadow%2Fsinatra-error/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RoxasShadow","download_url":"https://codeload.github.com/RoxasShadow/sinatra-error/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246811248,"owners_count":20837745,"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":[],"created_at":"2024-12-15T04:17:43.778Z","updated_at":"2025-04-02T11:45:07.937Z","avatar_url":"https://github.com/RoxasShadow.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Sinatra::Error\n=============================\nError handling in Sinatra like Grape.\n\n-----------------------------\n\nLike in Grape, now you can do this in Sinatra\n\n`$ gem install sinatra-error`\n\n```ruby\nrequire 'sinatra'\nrequire 'sinatra/error'\n\n# parameters:\n#\tmessage =\u003e String or Hash with the output\n#\tstatus  =\u003e Integer (default  403)\n#\tformat  =\u003e Symbol  (default  :json)\n\t\nerror!({ 'error' =\u003e 'unauthorized', 'detail' =\u003e 'login required' }, 401) unless logged?\n\t# {\"error\":\"unauthorized\",\"detail\":\"login required\"}\nerror!('unauthorized', 401) unless logged?\n\t# {\"error\":\"unauthorized\"}\nerror!('unauthorized', 401, :txt) unless logged?\n\t# unauthorized\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froxasshadow%2Fsinatra-error","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froxasshadow%2Fsinatra-error","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froxasshadow%2Fsinatra-error/lists"}