Commit e6f7948c authored by jan.koester's avatar jan.koester
Browse files

better error handling

parent 7280b41e
Loading
Loading
Loading
Loading
Loading
+6 −1
Changes for client/client.cpp: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF DAMAGE.
 *******************************************************************************/

#include <iostream>
#include <vector>
#include <sstream>
#include <algorithm>
@@ -35,6 +36,8 @@
#include <json_types.h>
#include <json_tokener.h>

#include <httppp/exception.h>

#include "client.h"

authdb::client::ClientConnection::ClientConnection(){
@@ -85,8 +88,10 @@ authdb::client::Client::Client(ClientConnection& clt) : _Con(clt){
            libhttppp::HttpRequest nreq;
            nreq.setHeaderData("accept")->push_back("text/html");
            _Con._Client->Get(nreq);
        }catch(libhttppp::HTTPException &e){
            throw(authdb::AuthBackendError("Auth Connect HttpError: "+e.what()));
        }catch(...){
            _Con._Client->reconnect();
            throw(authdb::AuthBackendError("Unkwon Error Auth Connect!"));
        }
    }
}