src/DataTableAbstract.php
protected function errorResponse(\Exception $exception)
    {
        $error = $this->config->get('datatables.error');
        $debug = $this->config->get('app.debug');

        if ($error === 'throw' || (! $error && ! $debug)) {
            throw new Exception($exception->getMessage(), $code = 0, $exception);
        }

        $this->getLogger()->error($exception);

        return new JsonResponse([
            'draw'            => (int) $this->request->input('draw'),
            'recordsTotal'    => $this->totalRecords,
            'recordsFiltered' => 0,
            'data'            => [],
            'error'           => $error ? __($error) : "Exception Message:\n\n".$exception->getMessage(),
        ]);
    }
protected function errorResponse(\Exception $exception)
    {
        $error = $this->config->get('datatables.error');
        $debug = $this->config->get('app.debug');

        if ($error === 'throw' || (! $error && ! $debug)) {
            throw new Exception($exception->getMessage(), $code = 0, $exception);
        }

        $this->getLogger()->error($exception);

        return new JsonResponse([
            'draw'            => (int) $this->request->input('draw'),
            'recordsTotal'    => $this->totalRecords,
            'recordsFiltered' => 0,
            'data'            => [],
            'error'           => $error ? __($error) : "Exception Message:\n\n".$exception->getMessage(),
        ]);
    }
protected function errorResponse ( \ Exception $ exception ) { $ error = $ this -> config -> get ( 'datatables.error' ) ; $ debug = $ this -> config -> get ( 'app.debug' ) ; if ( $ error === 'throw' || ( ! $ error && ! $ debug ) ) { throw new Exception ( $ exception -> getMessage ( ) , $ code = 0 , $ exception ) ; } $ this -> getLogger ( ) -> error ( $ exception ) ; return new JsonResponse ( [ 'draw' => ( int ) $ this -> request -> input ( 'draw' ) , 'recordsTotal' => $ this -> totalRecords , 'recordsFiltered' => 0 , 'data' => [ ] , 'error' => $ error ? __ ( $ error ) : "Exception Message:\n\n" . $ exception -> getMessage ( ) , ] ) ; }
Return an error json response.

@param \Exception $exception
@return \Illuminate\Http\JsonResponse
@throws \Yajra\DataTables\Exceptions\Exception
Return an error json response .