summaryrefslogtreecommitdiff
path: root/emulate/emulator.hpp
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2018-06-16 16:27:49 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2018-06-16 16:27:49 +0200
commit6af709cc54d3f14155f34692716f598406d2ce6e (patch)
tree85179e623d61a65a7b464d0f16030da931f2f079 /emulate/emulator.hpp
parent95bc5cd73abd425045889638ccd7dc756419ac15 (diff)
downloadopenwar-6af709cc54d3f14155f34692716f598406d2ce6e.tar.gz
openwar-6af709cc54d3f14155f34692716f598406d2ce6e.tar.bz2
openwar-6af709cc54d3f14155f34692716f598406d2ce6e.zip
Some small reformattings.
Diffstat (limited to 'emulate/emulator.hpp')
-rw-r--r--emulate/emulator.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/emulate/emulator.hpp b/emulate/emulator.hpp
index fc33722..025c823 100644
--- a/emulate/emulator.hpp
+++ b/emulate/emulator.hpp
@@ -281,8 +281,14 @@ public:
{}
};
- void handle_instruction(_DInst inst) {
- opcode_handlers.at(inst.opcode)(inst);
+ bool handle_instruction(_DInst inst) {
+ try {
+ opcode_handlers.at(inst.opcode)(inst);
+ } catch(std::exception const& e) {
+ std::cerr << "Encountered fatal error: " << e.what() << std::endl;
+ return false;
+ }
+ return true;
}
};