diff --git a/utils/acsmdownloader.cpp b/utils/acsmdownloader.cpp index 98c63cd..af0a566 100644 --- a/utils/acsmdownloader.cpp +++ b/utils/acsmdownloader.cpp @@ -66,6 +66,7 @@ public: void run() { + int ret = 0; try { DRMProcessorClientImpl client; @@ -99,10 +100,10 @@ public: } catch(std::exception& e) { std::cout << e.what() << std::endl; - this->app->exit(1); + ret = 1; } - this->app->exit(0); + this->app->exit(ret); } private: diff --git a/utils/adept_activate.cpp b/utils/adept_activate.cpp index 641a38f..3811143 100644 --- a/utils/adept_activate.cpp +++ b/utils/adept_activate.cpp @@ -100,10 +100,10 @@ static std::string getpass(const char *prompt, bool show_asterisk=false) } -class Activate: public QRunnable +class ADEPTActivate: public QRunnable { public: - Activate(QCoreApplication* app): + ADEPTActivate(QCoreApplication* app): app(app) { setAutoDelete(false); @@ -111,6 +111,7 @@ public: void run() { + int ret = 0; try { DRMProcessorClientImpl client; @@ -124,10 +125,10 @@ public: } catch(std::exception& e) { std::cout << e.what() << std::endl; - this->app->exit(1); + ret = 1; } - this->app->exit(0); + this->app->exit(ret); } private: @@ -262,7 +263,7 @@ int main(int argc, char** argv) QCoreApplication app(argc, argv); - Activate activate(&app); + ADEPTActivate activate(&app); QThreadPool::globalInstance()->start(&activate); ret = app.exec(); diff --git a/utils/drmprocessorclientimpl.cpp b/utils/drmprocessorclientimpl.cpp index bc11a0f..a622325 100644 --- a/utils/drmprocessorclientimpl.cpp +++ b/utils/drmprocessorclientimpl.cpp @@ -119,7 +119,7 @@ std::string DRMProcessorClientImpl::sendHTTPRequest(const std::string& URL, cons } if (reply->error() != QNetworkReply::NoError) - EXCEPTION(gourou::CLIENT_NETWORK_ERROR, "Error " << reply->error()); + EXCEPTION(gourou::CLIENT_NETWORK_ERROR, "Error " << reply->errorString().toStdString()); if (gourou::logLevel >= gourou::DEBUG) {