diff --git a/app/Models/Address.php b/app/Models/Address.php index bfb3585..58a957a 100644 --- a/app/Models/Address.php +++ b/app/Models/Address.php @@ -5,6 +5,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +use Illuminate\Database\QueryException; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; @@ -468,8 +469,8 @@ class Address extends Model try { $so->addresses()->save($o); - } catch (\Exception $e) { - Log::error(sprintf('%s:! ERROR creating address [%s]',self::LOGKEY,get_class($e))); + } catch (QueryException $e) { + Log::error(sprintf('%s:! ERROR creating address [%s] (%s)',self::LOGKEY,$o->ftn,get_class($e))); return NULL; } diff --git a/app/Traits/ParseAddresses.php b/app/Traits/ParseAddresses.php index 4103b76..21b225f 100644 --- a/app/Traits/ParseAddresses.php +++ b/app/Traits/ParseAddresses.php @@ -3,6 +3,7 @@ namespace App\Traits; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; use App\Http\Controllers\DomainController; use App\Models\{Address,System,Zone}; @@ -51,6 +52,8 @@ trait ParseAddresses case 'path': if (! $ao) { $ftn = sprintf('%d:%d/%d@%s',$zone->zone_id,$net&DomainController::NUMBER_MAX,$node&DomainController::NUMBER_MAX,$zone->domain->name); + + Log::info(sprintf('%s:- Creating address [%s] for path',self::LOGKEY,$ftn)); $ao = Address::createFTN($ftn,System::createUnknownSystem()); }