All the exceptions thrown in Redaktilo live in the Gnugat\Redaktilo\Exception
namespace and implement a common interface allowing you to catch any of them
easily:
<?php
try {
// any operations made with Redaktilo
} catch (\Gnugat\Redaktilo\Exception\Exception $e) { ... }
Redaktilo's exceptions all have a descriptive message allowing developers to understand what went wrong. If the message is not enough, use their getter to get more context.
Here's the list of the exceptions that can be thrown:
- CommandNotFoundException
- NotSupportedException
- PatternNotFoundException
- InvalidLineNumberException
- DifferentLineBreaksFoundException
- FileNotFoundException
- IOException
- InvalidArgumentException
<?php
namespace Gnugat\Redaktilo\Exception;
class CommandNotFoundException extends \Exception implements Exception
{
public function getName();
public function getCommands();
}
<?php
namespace Gnugat\Redaktilo\Exception;
class NotSupportedException extends \Exception implements Exception
{
public function getPattern();
public function getSearchStrategies();
}
<?php
namespace Gnugat\Redaktilo\Exception;
class PatternNotFoundException extends \Exception implements Exception
{
public function getPattern();
public function getText();
}
<?php
namespace Gnugat\Redaktilo\Exception;
class InvalidLineNumberException extends \InvalidArgumentException implements Exception
{
public function getLineNumber();
public function getText();
}
<?php
namespace Gnugat\Redaktilo\Exception;
class DifferentLineBreaksFoundException extends \Exception implements Exception
{
public function getString();
public function getNumberLineBreakOther();
public function getNumberLineBreakWindows();
}
<?php
namespace Gnugat\Redaktilo\Exception;
class FileNotFoundException extends \RuntimeException implements Exception
{
public function getPath();
}
<?php
namespace Gnugat\Redaktilo\Exception;
class IOException extends \RuntimeException implements Exception
{
public function getPath();
}
<?php
namespace Gnugat\Redaktilo\Exception;
class InvalidArgumentException extends \InvalidArgumentException implements Exception
{
}