"platforms/reference/vscode:/vscode.git/clone" did not exist on "34a604b8f3ef3c0b3036d0882d829bd14360fa3b"
Commit acce09a5 authored by peastman's avatar peastman
Browse files

Handle exceptions correctly inside getState()

parent 5719a05d
......@@ -14,7 +14,13 @@
if (getForces) types |= State::Forces;
if (getEnergy) types |= State::Energy;
if (getParameters) types |= State::Parameters;
state = self->getState(types, enforcePeriodic, groups);
try {
state = self->getState(types, enforcePeriodic, groups);
}
catch (...) {
Py_END_ALLOW_THREADS
throw;
}
Py_END_ALLOW_THREADS
return _convertStateToLists(state);
}
......@@ -157,7 +163,13 @@ Parameters:
if (getForces) types |= State::Forces;
if (getEnergy) types |= State::Energy;
if (getParameters) types |= State::Parameters;
state = self->getState(copy, types, enforcePeriodic, groups);
try {
state = self->getState(copy, types, enforcePeriodic, groups);
}
catch (...) {
Py_END_ALLOW_THREADS
throw;
}
Py_END_ALLOW_THREADS
return _convertStateToLists(state);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment