diff options
author | Aki <please@ignore.pl> | 2022-04-12 18:33:34 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-04-12 18:33:34 +0200 |
commit | 9c1439b0e5e1c90723c0f2f6e22a24a935623542 (patch) | |
tree | f1999c9dc2e62c576fcc14f326992514ea20e016 /Starserver | |
parent | 220f110e298a211d0f508ed33bae0fa9e9bf4689 (diff) | |
download | starshatter-9c1439b0e5e1c90723c0f2f6e22a24a935623542.zip starshatter-9c1439b0e5e1c90723c0f2f6e22a24a935623542.tar.gz starshatter-9c1439b0e5e1c90723c0f2f6e22a24a935623542.tar.bz2 |
Changed error returning in DataLoader
This is to allow meaningful return values for identification of unique
sources.
Diffstat (limited to 'Starserver')
-rw-r--r-- | Starserver/StarServer.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Starserver/StarServer.cpp b/Starserver/StarServer.cpp index 12a3d90..ce83f81 100644 --- a/Starserver/StarServer.cpp +++ b/Starserver/StarServer.cpp @@ -64,13 +64,8 @@ StarServer::StarServer() : if (!loader) throw "Could not get DataLoader instance"; int loadstat = loader->EnableDatafile("shatter.dat"); - if (loadstat != DataLoader::DATAFILE_OK) { - if (loadstat == DataLoader::DATAFILE_INVALID) { - throw "The file 'shatter.dat' appears to have been damaged."; - } - else { - throw "Starshatter cannot open the file 'shatter.dat'. Please check current directory."; - } + if (loadstat == DataLoader::FAILED) { + throw loader->LastError(); } if (loader->FindFile("start.dat")) |