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 ''; return '';
$buf = ''; $buf = '';
try {
$rc = socket_recv($this->connection,$buf, $len,MSG_DONTWAIT); $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) if ($this->DEBUG)
Log::debug(sprintf('%s: - Read [%d]',self::LOGKEY,$rc)); Log::debug(sprintf('%s: - Read [%d]',self::LOGKEY,$rc));

View File

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

View File

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

View File

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

View File

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