comparison Core/JobsEngine/GenericJobUnserializer.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 2540ac79ab6c
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
2953:210d5afd8f2b 2954:d924f9bb61cc
53 { 53 {
54 return new SequenceOfOperationsJob(*this, source); 54 return new SequenceOfOperationsJob(*this, source);
55 } 55 }
56 else 56 else
57 { 57 {
58 LOG(ERROR) << "Cannot unserialize job of type: " << type; 58 throw OrthancException(ErrorCode_BadFileFormat,
59 throw OrthancException(ErrorCode_BadFileFormat); 59 "Cannot unserialize job of type: " + type);
60 } 60 }
61 } 61 }
62 62
63 63
64 IJobOperation* GenericJobUnserializer::UnserializeOperation(const Json::Value& source) 64 IJobOperation* GenericJobUnserializer::UnserializeOperation(const Json::Value& source)
69 { 69 {
70 return new LogJobOperation; 70 return new LogJobOperation;
71 } 71 }
72 else 72 else
73 { 73 {
74 LOG(ERROR) << "Cannot unserialize operation of type: " << type; 74 throw OrthancException(ErrorCode_BadFileFormat,
75 throw OrthancException(ErrorCode_BadFileFormat); 75 "Cannot unserialize operation of type: " + type);
76 } 76 }
77 } 77 }
78 78
79 79
80 JobOperationValue* GenericJobUnserializer::UnserializeValue(const Json::Value& source) 80 JobOperationValue* GenericJobUnserializer::UnserializeValue(const Json::Value& source)
89 { 89 {
90 return new NullOperationValue; 90 return new NullOperationValue;
91 } 91 }
92 else 92 else
93 { 93 {
94 LOG(ERROR) << "Cannot unserialize value of type: " << type; 94 throw OrthancException(ErrorCode_BadFileFormat,
95 throw OrthancException(ErrorCode_BadFileFormat); 95 "Cannot unserialize value of type: " + type);
96 } 96 }
97 } 97 }
98 } 98 }
99 99