Commit 710248a5 authored by Mahmoud Bakhtvar's avatar Mahmoud Bakhtvar

Select it used for proper error handling

parent ba7beb66
...@@ -25,21 +25,17 @@ namespace C_UI ...@@ -25,21 +25,17 @@ namespace C_UI
{ {
var client = new DicomClient(_storeServerHost, _storeServerPort, false, _storeServerAET, _aet); var client = new DicomClient(_storeServerHost, _storeServerPort, false, _storeServerAET, _aet);
client.NegotiateAsyncOps(); client.NegotiateAsyncOps();
dicomFiles.ToObservable().Subscribe( dicomFiles.ToObservable()
async onNext => .Select(async onNext =>
{ {
var request = new DicomCStoreRequest(onNext); var request = new DicomCStoreRequest(onNext);
request.OnResponseReceived += (req, response) => logger.Info($"{response.Status}-{onNext}" ); request.OnResponseReceived += (req, response) => logger.Info($"{response.Status}-{onNext}");
await client.AddRequestAsync(request); await client.AddRequestAsync(request);
await client.SendAsync(); await client.SendAsync();
}, })
onError => .Subscribe(x => { }, onError => logger.Error(onError.Message), () => { });
{
logger.Error(onError.Message);
}
);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment