Skip to content

Commit fc27d2d

Browse files
committed
Improve error messages in SCP
Signed-off-by: Victor Chang <[email protected]>
1 parent 700fc72 commit fc27d2d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/InformaticsGateway/Services/Scp/ScpServiceInternal.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ public async Task OnReceiveAssociationRequestAsync(DicomAssociation association)
148148

149149
if (_associationDataProvider is null)
150150
{
151+
_associationInfo.Errors = $"Internal error: association data provider not found.";
151152
throw new ServiceException($"{nameof(UserState)} must be an instance of IAssociationDataProvider");
152153
}
153154

@@ -165,7 +166,7 @@ public async Task OnReceiveAssociationRequestAsync(DicomAssociation association)
165166

166167
if (!await IsValidSourceAeAsync(association.CallingAE, association.RemoteHost).ConfigureAwait(false))
167168
{
168-
_associationInfo.Errors = "Invalid source";
169+
_associationInfo.Errors = $"Invalid source. Called AE: {association.CalledAE}. Calling AE: {association.CallingAE}. IP: {association.RemoteHost}.";
169170

170171
await SendAssociationRejectAsync(
171172
DicomRejectResult.Permanent,
@@ -175,7 +176,7 @@ await SendAssociationRejectAsync(
175176

176177
if (!await IsValidCalledAeAsync(association.CalledAE).ConfigureAwait(false))
177178
{
178-
_associationInfo.Errors = "Invalid MONAI AE Title";
179+
_associationInfo.Errors = "Invalid MONAI AE Title. Called AE: {association.CalledAE}. Calling AE: {association.CallingAE}. IP: {association.RemoteHost}.";
179180

180181
await SendAssociationRejectAsync(
181182
DicomRejectResult.Permanent,
@@ -189,6 +190,7 @@ await SendAssociationRejectAsync(
189190
{
190191
if (!_associationDataProvider.Configuration.Value.Dicom.Scp.EnableVerification)
191192
{
193+
_associationInfo.Errors = "Verification service disabled. Called AE: {association.CalledAE}. Calling AE: {association.CallingAE}. IP: {association.RemoteHost}.";
192194
_logger?.VerificationServiceDisabled();
193195
await SendAssociationRejectAsync(
194196
DicomRejectResult.Permanent,
@@ -202,6 +204,7 @@ await SendAssociationRejectAsync(
202204
{
203205
if (!_associationDataProvider.CanStore)
204206
{
207+
_associationInfo.Errors = "Disk pressure. Called AE: {association.CalledAE}. Calling AE: {association.CallingAE}. IP: {association.RemoteHost}.";
205208
await SendAssociationRejectAsync(
206209
DicomRejectResult.Permanent,
207210
DicomRejectSource.ServiceUser,

0 commit comments

Comments
 (0)