mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-27 01:30:04 +02:00
33 lines
707 B
PHP
33 lines
707 B
PHP
<?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\Exception;
|
|
|
|
use Exception;
|
|
|
|
/**
|
|
* The Task Failed, and it has a Custom Message
|
|
*
|
|
* @author Andrés Montañez <andresmontanez@gmail.com>
|
|
*/
|
|
class ErrorException extends Exception
|
|
{
|
|
public function getTrimmedMessage($maxLength = 60)
|
|
{
|
|
$message = $this->getMessage();
|
|
|
|
if (strlen($message) > $maxLength) {
|
|
$message = substr($message, 0, $maxLength) . '...';
|
|
}
|
|
|
|
return $message;
|
|
}
|
|
}
|