Commit 9214f0eb authored by Seblu's avatar Seblu

Print error code in log file on error

parent 68cecfc7
......@@ -77,9 +77,20 @@ int main(int argc, char *argv[])
return ERR_NO;
catch (const Error &e) {
if (S.started()) S.stop();
if (D.opened()) D.close();
// Close server if started
if (S.started())
// Save data in database
if (D.opened())
// print error
// Print exit code if in daemon and verbose mode
if (O.daemon && O.verbose) std::cerr << "Exit with code: " << e.code() << std::endl;
return e.code();
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