From: Felix Dörre Date: Wed, 14 Oct 2015 22:46:10 +0000 (+0200) Subject: fix: catch another exception X-Git-Url: http://code.wpia.club/?a=commitdiff_plain;h=284fe577c65bbdda151d80e2261617a4c7119ed5;p=cassiopeia.git fix: catch another exception --- diff --git a/src/apps/client.cpp b/src/apps/client.cpp index 71d41db..96e5b67 100644 --- a/src/apps/client.cpp +++ b/src/apps/client.cpp @@ -110,8 +110,12 @@ int main( int argc, const char* argv[] ) { lastCRLCheck = current; } - std::shared_ptr job = jp->fetchJob(); - + std::shared_ptr job; + try { + job = jp->fetchJob(); + } catch ( std::exception &e ){ + logger::errorf ( "Exception while fetchJob: %s", e.what() ); + } if( !job ) { logger::note( "Nothing to work on." ); sleep( 5 ); diff --git a/src/db/psql.cpp b/src/db/psql.cpp index 44bc150..619c3a7 100644 --- a/src/db/psql.cpp +++ b/src/db/psql.cpp @@ -7,7 +7,7 @@ #include PostgresJobProvider::PostgresJobProvider( const std::string& server, const std::string& user, const std::string& password, const std::string& database ): - c("dbname="+database+" host="+server+" user="+user+" password="+password){ + c("dbname="+database+" host="+server+" user="+user+" password=" + password + " client_encoding=UTF-8 application_name=cassiopeia-client"){ // TODO better connection string generation?? }