diff options
author | Sebastian Reichel <sre@ring0.de> | 2013-03-27 00:06:53 +0100 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2013-03-27 00:06:53 +0100 |
commit | d6bdcc8895e38e8b4a61dd6e550103bce44e71b3 (patch) | |
tree | 9354480352fd5db323edb10f2595d3e28c6fa108 /src/web/websession.vala | |
parent | 52ea2214a6bb2b6e07def04cffd1bc2553d64077 (diff) | |
download | serial-barcode-scanner-d6bdcc8895e38e8b4a61dd6e550103bce44e71b3.tar.bz2 |
handle errors
Diffstat (limited to 'src/web/websession.vala')
-rw-r--r-- | src/web/websession.vala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/web/websession.vala b/src/web/websession.vala index 5c562c6..1dc6319 100644 --- a/src/web/websession.vala +++ b/src/web/websession.vala @@ -67,14 +67,14 @@ public class WebSession { return result; } - private void setup_auth(int user) { + private void setup_auth(int user) throws DatabaseError, IOError { var auth = db.get_user_auth(user); this.disabled = auth.disabled; this.superuser = auth.superuser; this.logged_in = true; } - public void logout() { + public void logout() throws DatabaseError, IOError { if(logged_in) { db.set_sessionid(user, ""); superuser = false; @@ -82,7 +82,7 @@ public class WebSession { } } - public WebSession(Soup.Server server, Soup.Message msg, string path, GLib.HashTable<string,string>? query, Soup.ClientContext client) { + public WebSession(Soup.Server server, Soup.Message msg, string path, GLib.HashTable<string,string>? query, Soup.ClientContext client) throws DatabaseError, IOError { var cookies = Soup.cookies_from_request(msg); /* Check for existing session */ @@ -95,7 +95,7 @@ public class WebSession { name = db.get_username(user); setup_auth(user); return; - } catch(WebSessionError e) { + } catch(DatabaseError e) { /* invalid session, ignore */ } } @@ -128,7 +128,7 @@ public class WebSession { user = userid; try { name = db.get_username(user); - } catch(WebSessionError e) { + } catch(DatabaseError e) { name = "Unknown User"; } |