<?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);
    }
}