2016-12-31 07:52:25 +01:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* This file is part of the Magallanes package.
|
|
|
|
*
|
|
|
|
* (c) Andrés Montañez <andres@andresmontanez.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Mage\Task;
|
|
|
|
|
|
|
|
use Exception;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Task Failed, and it has a Custom Message
|
|
|
|
*
|
|
|
|
* @author Andrés Montañez <andresmontanez@gmail.com>
|
|
|
|
*/
|
|
|
|
class ErrorException extends Exception
|
|
|
|
{
|
2017-01-01 07:55:09 +01:00
|
|
|
public function getTrimmedMessage($maxLength = 80)
|
2016-12-31 07:52:25 +01:00
|
|
|
{
|
|
|
|
$message = $this->getMessage();
|
|
|
|
|
|
|
|
if (strlen($message) > $maxLength) {
|
|
|
|
$message = substr($message, 0, $maxLength) . '...';
|
|
|
|
}
|
|
|
|
|
|
|
|
return $message;
|
|
|
|
}
|
|
|
|
}
|