comparison OrthancServer/Scheduler/DeleteInstanceCommand.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 52e71b25f9ce
children 0479d02c6778
comparison
equal deleted inserted replaced
1098:50c889af583b 1099:060e8918d7a4
42 for (ListOfStrings::const_iterator 42 for (ListOfStrings::const_iterator
43 it = inputs.begin(); it != inputs.end(); ++it) 43 it = inputs.begin(); it != inputs.end(); ++it)
44 { 44 {
45 LOG(INFO) << "Deleting instance " << *it; 45 LOG(INFO) << "Deleting instance " << *it;
46 46
47 Json::Value tmp; 47 try
48 context_.GetIndex().DeleteResource(tmp, *it, ResourceType_Instance); 48 {
49 Json::Value tmp;
50 context_.GetIndex().DeleteResource(tmp, *it, ResourceType_Instance);
51 }
52 catch (OrthancException& e)
53 {
54 LOG(ERROR) << "Unable to delete instance " << *it << " in a Lua script: " << e.What();
55 }
49 } 56 }
50 57
51 return true; 58 return true;
52 } 59 }
53 } 60 }