<?php

namespace App\Exceptions;

use Exception;

class GenericException extends Exception {

    protected $error;
    protected $message;
    protected $status;

    public function __construct($error, $message, $status) {
        $this->error = $error;
        $this->message = $message;
        $this->status = $status;
    }

    public function render($request) {
        return response()->json([
            'error' => $this->error,
            'message' => $this->message
        ], $this->status);
    }
}
