mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
catch and redirect back with error
This commit is contained in:
parent
dfd9fcc5e0
commit
60b70a4074
|
@ -627,7 +627,11 @@ class AssetsController extends Controller
|
|||
$csv->setHeaderOffset(0);
|
||||
$header = $csv->getHeader();
|
||||
$isCheckinHeaderExplicit = in_array('checkin date', (array_map('strtolower', $header)));
|
||||
$results = $csv->getRecords();
|
||||
try {
|
||||
$results = $csv->getRecords();
|
||||
} catch (\Exception $e) {
|
||||
return back()->with('error', 'There was an error reading the CSV file: '.$e->getMessage());
|
||||
}
|
||||
$item = [];
|
||||
$status = [];
|
||||
$status['error'] = [];
|
||||
|
|
Loading…
Reference in a new issue