Attempt to catch errors creating address for dovenet mail
This commit is contained in:
parent
62f0c1a909
commit
c7e707c143
@ -5,6 +5,7 @@ namespace App\Models;
|
|||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
use Illuminate\Database\QueryException;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
@ -468,8 +469,8 @@ class Address extends Model
|
|||||||
try {
|
try {
|
||||||
$so->addresses()->save($o);
|
$so->addresses()->save($o);
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (QueryException $e) {
|
||||||
Log::error(sprintf('%s:! ERROR creating address [%s]',self::LOGKEY,get_class($e)));
|
Log::error(sprintf('%s:! ERROR creating address [%s] (%s)',self::LOGKEY,$o->ftn,get_class($e)));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace App\Traits;
|
namespace App\Traits;
|
||||||
|
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
use App\Http\Controllers\DomainController;
|
use App\Http\Controllers\DomainController;
|
||||||
use App\Models\{Address,System,Zone};
|
use App\Models\{Address,System,Zone};
|
||||||
@ -51,6 +52,8 @@ trait ParseAddresses
|
|||||||
case 'path':
|
case 'path':
|
||||||
if (! $ao) {
|
if (! $ao) {
|
||||||
$ftn = sprintf('%d:%d/%d@%s',$zone->zone_id,$net&DomainController::NUMBER_MAX,$node&DomainController::NUMBER_MAX,$zone->domain->name);
|
$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());
|
$ao = Address::createFTN($ftn,System::createUnknownSystem());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user