summaryrefslogtreecommitdiff
path: root/server/src/journal_uploadserver.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/journal_uploadserver.cc')
-rw-r--r--server/src/journal_uploadserver.cc26
1 files changed, 17 insertions, 9 deletions
diff --git a/server/src/journal_uploadserver.cc b/server/src/journal_uploadserver.cc
index a1299ec..eac6cd5 100644
--- a/server/src/journal_uploadserver.cc
+++ b/server/src/journal_uploadserver.cc
@@ -163,7 +163,10 @@ JournalUploadServer::JournalUploadServer(std::string host,
}
void JournalUploadServer::commit()
+ throw(Journal::Exception)
{
+ int ret = 0;
+
#ifdef USE_MULTIPLE_USERS
std::string resume;
std::string olduser;
@@ -177,9 +180,12 @@ void JournalUploadServer::commit()
}
if(i->second.user != olduser && olduser != "" && resume != "") {
- journal_commit(patientID().c_str(), olduser.c_str(),
- host.c_str(), port,
- resume.c_str(), resume.size());
+ ret = journal_commit(patientID().c_str(), olduser.c_str(),
+ host.c_str(), port,
+ resume.c_str(), resume.size());
+
+ if(ret == -1) throw Journal::Exception("Journal Commit error.");
+
// FIXME - UGLY HACK: Avoid upload server spooling in the wrong order.
usleep(200000);
resume = "";
@@ -195,9 +201,9 @@ void JournalUploadServer::commit()
if(resume == "") return;
- journal_commit(patientID().c_str(), olduser.c_str(),
- host.c_str(), port,
- resume.c_str(), resume.size());
+ ret = journal_commit(patientID().c_str(), olduser.c_str(),
+ host.c_str(), port,
+ resume.c_str(), resume.size());
#else
std::string resume;
std::string user;
@@ -222,10 +228,12 @@ void JournalUploadServer::commit()
if(resume == "") return;
// Connect to praxisuploadserver and commit all resumes in one bulk.
- journal_commit(patientID().c_str(), user.c_str(),
- host.c_str(), port,
- resume.c_str(), resume.size());
+ ret = journal_commit(patientID().c_str(), user.c_str(),
+ host.c_str(), port,
+ resume.c_str(), resume.size());
#endif/*USE_MULTIPLE_USERS*/
+
+ if(ret == -1) throw Journal::Exception("Journal Commit error.");
}