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