diff options
-rw-r--r-- | NodeOutput.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/NodeOutput.cpp b/NodeOutput.cpp index d47b6a3..00ca006 100644 --- a/NodeOutput.cpp +++ b/NodeOutput.cpp @@ -1,4 +1,6 @@ #include "NodeOutput.h" +#include "Exception.h" + #include <iostream> NodeOutput NodeOutput::instance(NodeOutput::type); @@ -6,11 +8,10 @@ NodeOutput NodeOutput::instance(NodeOutput::type); NodeOutput::NodeOutput(const char * type) : Node(type) { } void NodeOutput::sim() { - if (this->inputs.size() > 0) { - std::cout << this->inputs[0]->getLevel() << "foo" << std::endl; - } else { - std::cout << "err: No inputs on probe" << std::endl; - } + if (this->inputs.size() == 0) + throw CircuitException("No inputs on probe"); + + std::cout << this->inputs[0]->getLevel() << "foo" << std::endl; } NodeOutput::NodeOutput(const NodeOutput * prototype) : Node() { } |