Custom routing processing

www.domain.com/testurl if laravel does not exist for this route, it will report an error
Sorry, the page you are looking for could not be found.
now I want to show him the same type or other content when the current route does not exist, instead of displaying the error of this route

Mar.15,2021

Route::get('{module}/{class}/{action}', function($module, $class, $action)
{
    $class = 'App\\Http\\Controllers\\' . $module . '\\' . $class . 'Controller';
    if (class_exists($class))
    {
        $classObject = new $class;
        if (method_exists($classObject, $action))
        {
           return call_user_func(array($classObject,$action));
        }
    }
    return "66666";
});
Menu