wi-adrema-plugin/exceptions/ComponentException.php

20 lines
450 B
PHP
Raw Normal View History

2024-02-01 00:23:58 +01:00
<?php
namespace Silva\Adrema\Exceptions;
use App;
use ApplicationException;
use Lang;
use Throwable;
class ComponentException extends ApplicationException
{
public function __construct($message = "", $code = 0, Throwable $previous = null)
{
$translations = json_decode(file_get_contents(__DIR__ . '/../lang/en.json'), true);
parent::__construct($translations['errors.' . $message] ?? $message, $code, $previous);
}
}