Attempt to catch errors creating address for dovenet mail

This commit is contained in:
2023-10-04 12:17:16 +11:00
parent 62f0c1a909
commit c7e707c143
2 changed files with 6 additions and 2 deletions

View File

@@ -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;
}