Fix 404 exception caught at production laravel logs

This commit is contained in:
Dillon Ngo
2024-03-08 08:46:05 +08:00
parent 758498f486
commit 252636a7df
2 changed files with 11 additions and 1 deletions
@@ -29,7 +29,12 @@ class CheckForStorageInvoiceByOrderId
public function handle(Request $request, Closure $next)
{
$orderId = $request->route('id');
$storages = $this->storageInvoiceTransactionProcessor->execute($orderId);
$storages = [];
try{
$storages = $this->storageInvoiceTransactionProcessor->execute($orderId);
} catch (\Exception $exception) {
$storages = [];
}
$request->merge(['storages' => $storages]);
return $next($request);
}
@@ -215,6 +215,11 @@
this.isLoading = false;
this.order = response.payload.data;
},
errorHandler(error, status){
if(status == 404){
window.location.href = this.route('error.404');
}
},
getStorageInfo(invoice) {
const storageObject = this.findStorageInfoObject(invoice.id);
return storageObject;