orisai/exceptions

Exceptions designed for static analysis and easy usage

1.1.2 2022-12-09 15:54 UTC

This package is auto-updated.

Last update: 2023-01-09 16:11:37 UTC


README

Exceptions designed for static analysis and easy usage

📄 Check out our documentation.

💸 If you like Orisai, please make a donation. Thank you!

badge.svg 68747470733a2f2f62616467656e2e6e65742f636f766572616c6c732f632f6769746875622f6f72697361692f657863657074696f6e732f76312e783f63616368653d333030 68747470733a2f2f62616467652e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f6f72697361692f657863657074696f6e732f76312e78 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f6f72697361692f657863657074696f6e733f63616368653d33363030 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f6f72697361692f657863657074696f6e733f63616368653d33363030 68747470733a2f2f62616467656e2e6e65742f62616467652f6c6963656e73652f4d504c2d322e302f626c75653f63616368653d33363030

use Orisai\Exceptions\Logic\InvalidState;
use Orisai\Exceptions\Message;

$message = Message::create()
    ->withContext('Trying to commit an import.')
    ->withProblem('There is nothing to commit.')
    ->withSolution('Check that the import files are not empty, and that filters are not too restrictive.');

throw InvalidState::create()
    ->withMessage($message);

... and more.