Mercurial > hg > orthanc
comparison OrthancServer/Scheduler/StoreScuCommand.cpp @ 1099:060e8918d7a4
More fault-tolerant commands in Lua scripts
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 07 Aug 2014 10:02:22 +0200 |
parents | 871c49c9b11d |
children | 0561f2087cc9 |
comparison
equal
deleted
inserted
replaced
1098:50c889af583b | 1099:060e8918d7a4 |
---|---|
52 it = inputs.begin(); it != inputs.end(); ++it) | 52 it = inputs.begin(); it != inputs.end(); ++it) |
53 { | 53 { |
54 LOG(INFO) << "Sending resource " << *it << " to modality \"" | 54 LOG(INFO) << "Sending resource " << *it << " to modality \"" |
55 << modality_.GetApplicationEntityTitle() << "\""; | 55 << modality_.GetApplicationEntityTitle() << "\""; |
56 | 56 |
57 std::string dicom; | 57 try |
58 context_.ReadFile(dicom, *it, FileContentType_Dicom); | 58 { |
59 locker.GetConnection().Store(dicom); | 59 std::string dicom; |
60 context_.ReadFile(dicom, *it, FileContentType_Dicom); | |
61 locker.GetConnection().Store(dicom); | |
60 | 62 |
61 outputs.push_back(*it); | 63 // Only chain with other commands if this command succeeds |
64 outputs.push_back(*it); | |
65 } | |
66 catch (OrthancException& e) | |
67 { | |
68 // Ignore transmission errors (e.g. if the remote modality is | |
69 // powered off) | |
70 LOG(ERROR) << "Unable to forward to a modality in a Lua script (instance " | |
71 << *it << "): " << e.What(); | |
72 } | |
62 } | 73 } |
63 | 74 |
64 return true; | 75 return true; |
65 } | 76 } |
66 } | 77 } |