comparison Core/JobsEngine/JobsRegistry.cpp @ 3162:94a4f75cc746

Fix issue #119 (/patients/.../archive returns a 500 when JobsHistorySize is 0)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 24 Jan 2019 16:47:05 +0100
parents 4e43e67f8ecf
children 053e72ff9fc5
comparison
equal deleted inserted replaced
3161:5cf29046c159 3162:94a4f75cc746
753 753
754 for (;;) 754 for (;;)
755 { 755 {
756 if (!GetStateInternal(state, id)) 756 if (!GetStateInternal(state, id))
757 { 757 {
758 // Job has finished and has been lost (should not happen) 758 // Job has finished and has been lost (typically happens if
759 state = JobState_Failure; 759 // "JobsHistorySize" is 0)
760 break; 760 throw OrthancException(ErrorCode_InexistentItem,
761 "Cannot retrieve the status of the job, "
762 "make sure that \"JobsHistorySize\" is not 0");
761 } 763 }
762 else if (state == JobState_Failure) 764 else if (state == JobState_Failure)
763 { 765 {
764 // Failure 766 // Failure
765 break; 767 break;