diff --git a/app/Jobs/NodelistImport.php b/app/Jobs/NodelistImport.php index 0c1c285..4cb1a59 100644 --- a/app/Jobs/NodelistImport.php +++ b/app/Jobs/NodelistImport.php @@ -343,7 +343,14 @@ class NodelistImport implements ShouldQueue } // Save the system record - $so->save(); + try { + $so->save(); + + } catch (\Exception $e) { + Log::error(sprintf('%s:Error with line [%s] (%s)',self::LOGKEY,$line,$e->getMessage()),['fields'=>$fields]); + DB::rollBack(); + throw new \Exception($e->getMessage()); + } // If our zone didnt exist, we'll create it with this system if (! $zo->exists) { @@ -365,6 +372,8 @@ class NodelistImport implements ShouldQueue } catch (\Exception $e) { Log::error(sprintf('%s:Error with line [%s] (%s)',self::LOGKEY,$line,$e->getMessage()),['fields'=>$fields]); + DB::rollBack(); + throw new \Exception($e->getMessage()); } if (! ($c % 100)) {