<?php


namespace App\Exceptions;

use Illuminate\Http\Request;

class ApiException extends \Exception
{
    public function __construct($code = 0, $message = '', \Throwable $previous = null)
    {
        parent::__construct($message, $code);
    }

    public function render(Request $request)
    {
        return response()->json(['code'=>$this->code, 'msg'=>$this->message, 'data'=>[]])->setEncodingOptions(JSON_UNESCAPED_UNICODE);
    }
}
