Catch packet errors and display a nice error

This commit is contained in:
Deon George
2021-06-29 23:42:35 +10:00
parent 7356bedfa2
commit 16a1d8a440
2 changed files with 20 additions and 1 deletions

View File

@@ -43,7 +43,13 @@ class HomeController extends Controller
continue;
foreach ($filegroup as $file) {
$pkt = new Packet($file);
try {
$pkt = new Packet($file);
} catch (\Exception $e) {
return redirect()->back()->withErrors($e->getMessage());
}
break;
}
}