Multiple exception bug fixes identified during testing

This commit is contained in:
Deon George 2021-10-07 23:32:05 +11:00
parent d0d6990d39
commit 83e06908b0
5 changed files with 19 additions and 6 deletions

View File

@ -285,7 +285,15 @@ final class SocketClient {
return '';
$buf = '';
$rc = socket_recv($this->connection,$buf, $len,MSG_DONTWAIT);
try {
$rc = socket_recv($this->connection,$buf, $len,MSG_DONTWAIT);
} catch (\Exception $e) {
Log::error(sprintf('%s: - socket_recv Exception [%s]',self::LOGKEY,$e->getMessage()));
throw new SocketException($x=socket_last_error($this->connection),socket_strerror($x));
}
if ($this->DEBUG)
Log::debug(sprintf('%s: - Read [%d]',self::LOGKEY,$rc));

View File

@ -67,6 +67,7 @@ class SystemController extends Controller
$oo = new Address;
$oo->zone_id = $request->post('zone_id');
$oo->region_id = $request->post('region_id_new');
$oo->host_id = 0;
$oo->node_id = 0;
$oo->point_id = 0;
$oo->role = DomainController::NODE_RC;

View File

@ -39,7 +39,7 @@ class EchoareaImport implements ShouldQueue
{
$this->file = $file;
$this->do = $do;
$this->prefix = $prefix;
$this->prefix = $prefix ?: '';
$this->delete_file = $delete_file;
$this->delete_recs = $delete_recs;
}

View File

@ -295,9 +295,13 @@ class NodelistImport implements ShouldQueue
// We'll search and see if we already have that system
} else {
$so = System::where('mailer_address',$address)
->where('mailer_port',$port)
->single();
// If we dont have $address/port
$so = NULL;
if ($address && $port)
$so = System::where('mailer_address',$address)
->where('mailer_port',$port)
->single();
if (! $so)
$so = System::where('name',$system)

View File

@ -86,7 +86,7 @@ final class Echomail extends Model implements Packet
/* ATTRIBUTES */
public function getKludgesAttribute(string $value): Collection
public function getKludgesAttribute(?string $value): Collection
{
return collect($this->castAttribute('kludges',$value));
}