Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在laravel中显示openpay错误_Laravel - Fatal编程技术网

在laravel中显示openpay错误

在laravel中显示openpay错误,laravel,Laravel,我使用的是OpenPay和Laravel,如果在我尝试对银行账户进行加密时出现错误,它会显示在Laravel错误页面(红色的页面)。如何在视图中显示错误?我使用了try-catch结构,作为额外的设置,我必须在每个异常之前添加****以避免默认的Laravel异常错误 try{ some code... }catch(\OpenpayApiTransactionError $e) { flash('Error ' . $e->getMessage())-&g

我使用的是OpenPay和Laravel,如果在我尝试对银行账户进行加密时出现错误,它会显示在Laravel错误页面(红色的页面)。如何在视图中显示错误?

我使用了try-catch结构,作为额外的设置,我必须在每个异常之前添加****以避免默认的Laravel异常错误

try{
some code...
}catch(\OpenpayApiTransactionError $e) {
                flash('Error ' . $e->getMessage())->error();
                $error = $e->getMessage();
                return redirect()->back()->with('error', $error)->with('valor', 'si');
                //return redirect('/codigos');
            } catch (\OpenpayApiRequestError $e) {
                flash('Error ' . $e->getMessage())->error();
                $error = $e->getMessage();
                return redirect()->back()->with('error', $error)->with('valor', 'si');
                //return redirect('/codigos');
            } catch (\OpenpayApiConnectionError $e) {
                flash('Error ' . $e->getMessage())->error();
                $error = $e->getMessage();
                return redirect()->back()->with('error', $error)->with('valor', 'si');
                //return redirect('/codigos');
            } catch (\OpenpayApiAuthError $e) {
                flash('Error ' . $e->getMessage())->error();
                $error = $e->getMessage();
                return redirect()->back()->with('error', $error)->with('valor', 'si');
                //return redirect('/codigos');
            } catch (\OpenpayApiError $e) {
                flash('Error ' . $e->getMessage())->error();
                $error = $e->getMessage();
                return redirect()->back()->with('error', $error)->with('valor', 'si');
                //return redirect('/codigos');
            } catch (\Exception $e) {
                flash('Error ' . $e->getMessage())->error();
                $error = $e->getMessage();
                return redirect()->back()->with('error', $error)->with('valor', 'si');
                //return redirect('/codigos');
            }
我希望其他人会觉得这很有用