{"id":25492531,"url":"https://github.com/slavcodev/exceptions","last_synced_at":"2025-11-08T21:30:29.405Z","repository":{"id":57089716,"uuid":"94883139","full_name":"slavcodev/exceptions","owner":"slavcodev","description":"Base exceptions classes extended with context information","archived":false,"fork":false,"pushed_at":"2018-12-27T16:07:09.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T08:49:58.810Z","etag":null,"topics":["exception-handling","exceptions"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slavcodev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-20T11:17:55.000Z","updated_at":"2023-09-13T09:33:21.000Z","dependencies_parsed_at":"2022-08-20T16:00:53.871Z","dependency_job_id":null,"html_url":"https://github.com/slavcodev/exceptions","commit_stats":null,"previous_names":["slavcodev/exceptions"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slavcodev%2Fexceptions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slavcodev%2Fexceptions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slavcodev%2Fexceptions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slavcodev%2Fexceptions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slavcodev","download_url":"https://codeload.github.com/slavcodev/exceptions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239561950,"owners_count":19659557,"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":["exception-handling","exceptions"],"created_at":"2025-02-18T22:30:47.434Z","updated_at":"2025-11-08T21:30:29.347Z","avatar_url":"https://github.com/slavcodev.png","language":"PHP","readme":"# Set of the base exceptions\n\n[![Build Status][ico-travis]][link-travis]\n[![Code Coverage][ico-scrutinizer]][link-scrutinizer]\n[![Quality Score][ico-code-quality]][link-code-quality]\n[![GitHub issues][ico-issues]][link-issues]\n\n[![Software License][ico-license]][link-license]\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![PHP Version][ico-php-version]][link-github]\n\nThis repository contains a set of useful exception classes.\n\nThe exception classes interface is extended with array of context data,\nbecause often the message and the code are not enough to debug. \n\n## Install\n\nUsing [Composer](https://getcomposer.org):\n\n```bash\ncomposer require zeeproject/exceptions\n```\n\n## Usage\n\nThrow exceptions as usual, but you are able also to add context values:\n\n~~~php\nthrow new InvalidArgumentException('Something went wrong', [\n    'key' =\u003e 'value',\n]);\n~~~\n\nNow you can handle this exception, e.q. your error handler may log error details:\n\n~~~php\nfinal class ErrorHandler\n{\n    private $logger;\n\n    public function __construct(Psr\\Log\\LoggerInterface $logger)\n    {\n        $this-\u003elogger = $logger;\n    }\n\n    public function handleException(Exception $exception)\n    {\n        if ($exception instanceof Zee\\Exceptions\\Throwable) {\n            $this-\u003elogger-\u003eerror($exception-\u003egetMessage(), $exception-\u003egetContext());\n        } else {\n            $this-\u003elogger-\u003eerror($exception-\u003egetMessage());\n        }\n    }\n}\n~~~\n\n## Testing\n\n```bash\nphpunit\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CODE OF CONDUCT](CODE_OF_CONDUCT.md) for more details.\n\n[ico-version]: https://img.shields.io/packagist/v/zeeproject/exceptions.svg?style=for-the-badge\u0026label=Latest\n[ico-php-version]: https://img.shields.io/packagist/php-v/zeeproject/exceptions.svg?style=for-the-badge\n[ico-license]: https://img.shields.io/badge/License-BSD%202--Clause-blue.svg?style=for-the-badge\n[ico-issues]: https://img.shields.io/github/issues/zee/exceptions.svg?style=for-the-badge\u0026logo=github\n[ico-travis]: https://img.shields.io/travis/zee/exceptions.svg?style=for-the-badge\u0026logo=travis\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/zee/exceptions.svg?style=for-the-badge\u0026logo=scrutinizer\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/zee/exceptions.svg?style=for-the-badge\u0026logo=scrutinizer\n\n[link-packagist]: https://packagist.org/packages/zeeproject/exceptions\n[link-github]: https://github.com/zee/exceptions\n[link-issues]: https://github.com/zee/exceptions/issues\n[link-license]: LICENSE\n[link-travis]: https://travis-ci.org/zee/exceptions\n[link-scrutinizer]: https://scrutinizer-ci.com/g/zee/exceptions/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/zee/exceptions\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslavcodev%2Fexceptions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslavcodev%2Fexceptions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslavcodev%2Fexceptions/lists"}