{"id":21716488,"url":"https://github.com/majidimanzade/saoshyant","last_synced_at":"2025-08-25T10:13:59.745Z","repository":{"id":56894274,"uuid":"239327094","full_name":"majidimanzade/saoshyant","owner":"majidimanzade","description":"Rails Exception Handeler","archived":false,"fork":false,"pushed_at":"2020-03-08T09:35:24.000Z","size":17,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T08:01:41.537Z","etag":null,"topics":["error-handling","exception-handling","exceptions","rails","rails-error-handeling","rails-exceptions","render","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/majidimanzade.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}},"created_at":"2020-02-09T15:29:41.000Z","updated_at":"2024-03-16T12:22:55.000Z","dependencies_parsed_at":"2022-08-20T17:10:19.188Z","dependency_job_id":null,"html_url":"https://github.com/majidimanzade/saoshyant","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/majidimanzade%2Fsaoshyant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/majidimanzade%2Fsaoshyant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/majidimanzade%2Fsaoshyant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/majidimanzade%2Fsaoshyant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/majidimanzade","download_url":"https://codeload.github.com/majidimanzade/saoshyant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625505,"owners_count":21135513,"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":["error-handling","exception-handling","exceptions","rails","rails-error-handeling","rails-exceptions","render","ruby","ruby-gem"],"created_at":"2024-11-26T01:11:37.040Z","updated_at":"2025-04-12T20:12:13.983Z","avatar_url":"https://github.com/majidimanzade.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Saoshyant\n\n**Saoshyant is an exception handler Gem** that allows you to customize your exceptions to have a custom reaction when error raised in rails Application.\n\nWhen you Encountering to an error in Rails Application it shows Red Page and explains Exception. With Saoshyant you can log or render error with custom status code.\n\nthe Most Usage of Saoshyant is in Rest Apis Applications that you need to render errors with custom error code and messages.\n\n## Requirements\n* Rails: 3.0.0+\n\n## Installation\nAdd Saoshyant to your Gemfile:\n```sh\ngem 'saoshyant'\n```\n\n## Getting Start\n\nin blowe Example we want to render `Exceptions` messages in json format.\n\n```rb\nclass PageController \u003c ApplicationController\n  include Saoshyant\n\n  def initialize\t\t\n    saoshyant do |status_code, msg, exception_klass|\n      render json: {message: msg, error_class_name: exception_klass}, status: status_code\n    end\n  end\nend\n\n```\n\n### How Customize Status Code and Log\ndefault status code in saoshyant gem is `500` error code and it doesnt log Exceptions.\n\nif you want to customize Status Code and Log you can use `saoshyant_option` methode:\n```rb\nsaoshyant_option(ExceptionClass, StatusCode, LogFlag)\n```\n```rb\nclass PageController \u003c ApplicationController\n  include Saoshyant\n\n  def initialize\n    saoshyant_option(NameError, 402, true)\n    saoshyant do |status_code, msg, exception_klass|\n      render json: {message: msg, error_class_name: exception_klass}, status: status_code\n    end\n  end\nend\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmajidimanzade%2Fsaoshyant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmajidimanzade%2Fsaoshyant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmajidimanzade%2Fsaoshyant/lists"}