Mercurial > hg > orthanc
comparison Core/DicomNetworking/DicomUserConnection.cpp @ 2954:d924f9bb61cc
taking advantage of details in OrthancException
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 03 Dec 2018 14:35:34 +0100 |
parents | 61a5667f37d9 |
children | 4e43e67f8ecf |
comparison
equal
deleted
inserted
replaced
2953:210d5afd8f2b | 2954:d924f9bb61cc |
---|---|
162 | 162 |
163 static void Check(const OFCondition& cond) | 163 static void Check(const OFCondition& cond) |
164 { | 164 { |
165 if (cond.bad()) | 165 if (cond.bad()) |
166 { | 166 { |
167 LOG(ERROR) << "DicomUserConnection: " << std::string(cond.text()); | 167 throw OrthancException(ErrorCode_NetworkProtocol, |
168 throw OrthancException(ErrorCode_NetworkProtocol); | 168 "DicomUserConnection: " + std::string(cond.text())); |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 void DicomUserConnection::PImpl::CheckIsOpen() const | 172 void DicomUserConnection::PImpl::CheckIsOpen() const |
173 { | 173 { |
174 if (!IsOpen()) | 174 if (!IsOpen()) |
175 { | 175 { |
176 LOG(ERROR) << "DicomUserConnection: First open the connection"; | 176 throw OrthancException(ErrorCode_NetworkProtocol, |
177 throw OrthancException(ErrorCode_NetworkProtocol); | 177 "DicomUserConnection: First open the connection"); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 | 181 |
182 void DicomUserConnection::CheckIsOpen() const | 182 void DicomUserConnection::CheckIsOpen() const |