You've already forked Atomcms-edit
34 lines
746 B
PHP
Executable File
34 lines
746 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Exceptions;
|
|
|
|
use Exception;
|
|
use Throwable;
|
|
|
|
class MigrationFailedException extends Exception
|
|
{
|
|
/**
|
|
* MigrationFailedException constructor.
|
|
*/
|
|
public function __construct(string $message = 'Migration failed', int $code = 0, ?Throwable $previous = null)
|
|
{
|
|
parent::__construct($message, $code, $previous);
|
|
}
|
|
|
|
/**
|
|
* Get the exception message with additional context
|
|
*/
|
|
public function getDetailedMessage(): string
|
|
{
|
|
return 'Migration failed: ' . $this->getMessage() . ' (Code: ' . $this->getCode() . ')';
|
|
}
|
|
|
|
/**
|
|
* Get the exception code with default
|
|
*/
|
|
public function getErrorCode(): int
|
|
{
|
|
return $this->getCode() ?: 500;
|
|
}
|
|
}
|