/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
if($e instanceof INotFoundException)
{
// makes 404 error if something haven't found
$e = new NotFoundHttpException($e->getMessage(), $e);
}
if($e instanceof IErrorMessageException)
{
return redirect()->back()->with('error', $e->getMessage())->withInput();
}
return parent::render($request, $e);
}