diff options
author | David Robillard <d@drobilla.net> | 2007-03-31 20:41:51 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-03-31 20:41:51 +0000 |
commit | 8bb02cb8c13430808fd4bb02e62942cace3fb65b (patch) | |
tree | 28af333ccd0ad6831f178981b7d611fe4678195d /src/StateManager.cpp | |
parent | 47372f00cc6fe39f65594aa6edf6544157e94ce7 (diff) | |
download | patchage-8bb02cb8c13430808fd4bb02e62942cace3fb65b.tar.gz patchage-8bb02cb8c13430808fd4bb02e62942cace3fb65b.tar.bz2 patchage-8bb02cb8c13430808fd4bb02e62942cace3fb65b.zip |
Random exception changes (voodoo debugging for certain broke-ass gentoo systems).
git-svn-id: http://svn.drobilla.net/lad/patchage@386 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/StateManager.cpp')
-rw-r--r-- | src/StateManager.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/StateManager.cpp b/src/StateManager.cpp index f00daa8..85a78cf 100644 --- a/src/StateManager.cpp +++ b/src/StateManager.cpp @@ -16,6 +16,7 @@ */ #include "StateManager.h" +#include <stdexcept> #include <stdlib.h> #include <iostream> #include <fstream> @@ -106,21 +107,21 @@ StateManager::load(const string& filename) string s; is >> s; - if (s != "window_location") throw "Corrupt settings file."; + if (s != "window_location") throw std::runtime_error("Corrupt settings file."); is >> s; _window_location.x = atoi(s.c_str()); is >> s; _window_location.y = atoi(s.c_str()); is >> s; - if (s != "window_size") throw "Corrupt settings file."; + if (s != "window_size") throw std::runtime_error("Corrupt settings file."); is >> s; _window_size.x = atoi(s.c_str()); is >> s; _window_size.y = atoi(s.c_str()); is >> s; - if (s != "zoom_level") throw "Corrupt settings file."; + if (s != "zoom_level") throw std::runtime_error("Corrupt settings file."); is >> s; _zoom = atof(s.c_str()); @@ -150,7 +151,7 @@ StateManager::load(const string& filename) if (s == "input") ml.type = Input; else if (s == "output") ml.type = Output; else if (s == "inputoutput") ml.type = InputOutput; - else throw "Corrupt settings file."; + else throw std::runtime_error("Corrupt settings file."); is >> s; ml.loc.x = atoi(s.c_str()); @@ -182,7 +183,7 @@ StateManager::save(const string& filename) if (ml.type == Input) os << " input "; else if (ml.type == Output) os << " output "; else if (ml.type == InputOutput) os << " inputoutput "; - else throw; + else throw std::runtime_error("Invalid module type"); os << ml.loc.x << " " << ml.loc.y << std::endl; } |