summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authordeva <deva>2008-08-05 08:01:52 +0000
committerdeva <deva>2008-08-05 08:01:52 +0000
commit817402b5208b0dbc92a64ed094a936c56c8c1e49 (patch)
treec53aa5e2c86cc059903becba8de0112a82a8d748 /server
parent98b90925d863531c3a6c75de15fb686b1fb1891f (diff)
Added catch of non responding postgresql database.
Diffstat (limited to 'server')
-rw-r--r--server/src/server.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/server.cc b/server/src/server.cc
index 353708f..a419181 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -54,7 +54,7 @@ static std::string error_box(std::string message)
std::string errorbox =
" <course name=\"error\">\n"
" <macro name=\"error\">\n"
- " <window caption=\"ERROR!\" height=\"240\" layout=\"vbox\" name=\"error\" width=\"320\">\n"
+ " <window caption=\"ERROR!\" height=\"300\" layout=\"vbox\" name=\"error\" width=\"480\">\n"
" <textedit name=\"errorlabel\" value=\"" + message + "\"/>\n"
" <button action=\"cancel\" caption=\"Luk\" name=\"cancel\"/>\n"
" </window>\n"
@@ -204,7 +204,9 @@ static void connection(TCPSocket &socket)
socket.write(answer);
i++;
}
- } catch(std::exception &e) {
+ } catch( PGSTD::runtime_error &e ) {
+ socket.write(error_box(xml_encode(std::string("PostgreSQL server error:\n") + e.what())));
+ } catch( std::exception &e ) {
socket.write(error_box(xml_encode(e.what())));
}