error handling
This commit is contained in:
parent
90dce16aea
commit
103df6436d
@ -4,13 +4,22 @@
|
|||||||
|
|
||||||
use App\Services\Pacs\Sync\StudiesSync;
|
use App\Services\Pacs\Sync\StudiesSync;
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use Exception;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
final readonly class ScanStudies
|
final readonly class ScanStudies
|
||||||
{
|
{
|
||||||
public function __invoke(StudiesSync $sync, Closure $next): StudiesSync
|
public function __invoke(StudiesSync $sync, Closure $next): StudiesSync
|
||||||
{
|
{
|
||||||
|
$study_ids = [];
|
||||||
|
try {
|
||||||
$study_ids = $sync->getClient()->getStudiesIds();
|
$study_ids = $sync->getClient()->getStudiesIds();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
Log::error($e->getMessage());
|
||||||
|
}
|
||||||
|
if (! empty($study_ids)) {
|
||||||
$sync->setStudyIds($study_ids);
|
$sync->setStudyIds($study_ids);
|
||||||
|
}
|
||||||
|
|
||||||
return $next($sync);
|
return $next($sync);
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ public function run(): void
|
|||||||
);
|
);
|
||||||
DicomServer::create(
|
DicomServer::create(
|
||||||
[
|
[
|
||||||
'is_active' => true,
|
'is_active' => false,
|
||||||
'server_name' => 'San Jose',
|
'server_name' => 'San Jose',
|
||||||
'geo_code' => 'US',
|
'geo_code' => 'US',
|
||||||
'host' => 'san-jose.mylabctg.com',
|
'host' => 'san-jose.mylabctg.com',
|
||||||
|
Loading…
Reference in New Issue
Block a user