Commit eb2e1ee3 authored by Jason Swails's avatar Jason Swails
Browse files

Remove NotImplementedError -- do everything through OpenMMException

parent 876329d4
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
/** /**
* Returns whether or not this force makes use of periodic boundary * Returns whether or not this force makes use of periodic boundary
* conditions. This method should be overridden for all Force subclasses, or * conditions. This method should be overridden for all Force subclasses, or
* a OpenMM::NotImplementedError will be thrown * a OpenMM::OpenMMException will be thrown
* *
* @return true if Force uses periodic boundaries or false if it does not * @return true if Force uses periodic boundaries or false if it does not
*/ */
......
...@@ -54,17 +54,6 @@ private: ...@@ -54,17 +54,6 @@ private:
std::string message; std::string message;
}; };
class NotImplementedError : public std::exception {
public:
explicit NotImplementedError(const std::string& message) : message(message) {
}
~NotImplementedError() throw() {
}
const char* what() const throw() {
return message.c_str();
}
};
} // namespace OpenMM } // namespace OpenMM
#endif /*OPENMM_OPENMMEXCEPTION_H_*/ #endif /*OPENMM_OPENMMEXCEPTION_H_*/
...@@ -228,7 +228,7 @@ public: ...@@ -228,7 +228,7 @@ public:
* Returns whether or not any forces in this System use periodic boundaries. * Returns whether or not any forces in this System use periodic boundaries.
* *
* If a force in this System does not implement usesPeriodicBoundaryConditions * If a force in this System does not implement usesPeriodicBoundaryConditions
* a NotImplementedError is thrown * a OpenMM::OpenMMException is thrown
* *
* @return true of at least one force uses PBC and false otherwise * @return true of at least one force uses PBC and false otherwise
*/ */
......
...@@ -50,7 +50,7 @@ void Force::setForceGroup(int group) { ...@@ -50,7 +50,7 @@ void Force::setForceGroup(int group) {
} }
bool Force::usesPeriodicBoundaryConditions() const { bool Force::usesPeriodicBoundaryConditions() const {
throw NotImplementedError("usesPeriodicBoundaryConditions is not implemented"); throw OpenMMException("usesPeriodicBoundaryConditions is not implemented");
} }
ForceImpl& Force::getImplInContext(Context& context) { ForceImpl& Force::getImplInContext(Context& context) {
......
...@@ -129,7 +129,7 @@ bool System::usesPeriodicBoundaryConditions() { ...@@ -129,7 +129,7 @@ bool System::usesPeriodicBoundaryConditions() {
try { try {
if ((*it)->usesPeriodicBoundaryConditions()) if ((*it)->usesPeriodicBoundaryConditions())
uses_pbc = true; uses_pbc = true;
} catch (NotImplementedError &e) { } catch (OpenMMException &e) {
all_forces_implement = false; all_forces_implement = false;
} }
} }
......
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