You've already forked Atomcms-edit
Initial commit
This commit is contained in:
Executable
+33
@@ -0,0 +1,33 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user