error handling

This commit is contained in:
Dr Masroor Ehsan 2025-01-28 23:39:57 +06:00
parent 90dce16aea
commit 103df6436d
2 changed files with 12 additions and 3 deletions

View File

@ -4,13 +4,22 @@
use App\Services\Pacs\Sync\StudiesSync;
use Closure;
use Exception;
use Illuminate\Support\Facades\Log;
final readonly class ScanStudies
{
public function __invoke(StudiesSync $sync, Closure $next): StudiesSync
{
$study_ids = $sync->getClient()->getStudiesIds();
$sync->setStudyIds($study_ids);
$study_ids = [];
try {
$study_ids = $sync->getClient()->getStudiesIds();
} catch (Exception $e) {
Log::error($e->getMessage());
}
if (! empty($study_ids)) {
$sync->setStudyIds($study_ids);
}
return $next($sync);
}

View File

@ -134,7 +134,7 @@ public function run(): void
);
DicomServer::create(
[
'is_active' => true,
'is_active' => false,
'server_name' => 'San Jose',
'geo_code' => 'US',
'host' => 'san-jose.mylabctg.com',