Updated error handling, added error contexts. Fixed fullscreen button
[situare] / src / common.h
index b104f72..0f400bd 100644 (file)
@@ -59,6 +59,8 @@ const QString FACEBOOK_LOGIN_ENDING = "&fbconnect=true&return_session=true&";
 // Situare errors
 namespace SituareError {
     enum errors {
+        ERROR_GENERAL = 0,          // an unknown/unspecified error
+        ERROR_MISSING_ARGUMENT,     // missing mandatory argument for requested action
         SESSION_EXPIRED = 10,       // situare session credentials expired
         LOGIN_FAILED,               // login to situare service failed
         UPDATE_FAILED,              // location update to situare failed
@@ -67,8 +69,18 @@ namespace SituareError {
         IMAGE_DOWNLOAD_FAILED,      // image download failed from facebook
         MAP_IMAGE_DOWNLOAD_FAILED,  // map image download failed from OSM
         GPS_INITIALIZATION_FAILED,  // GPS intialization failed
-        UNKNOWN_REPLY,              // unknown reply from situare server
-        INVALID_JSON                // JSON parsing failed i.e. invalid JSON string
+        INVALID_JSON,               // JSON parsing failed i.e. invalid JSON string
+        ERROR_GEOLOCATION_SERVER_UNAVAILABLE = 501, // reverseGeo server not responding
+        ERROR_GEOLOCATION_REQUEST_FAIL,             // reverseGeo response failed
+        ERROR_GEOLOCATION_LONLAT_INVALID            // reverseGeo failed, invalid lon/lat
+    };
+}
+
+// Error contexts
+namespace ErrorContext {
+    enum context {
+        SITUARE = 0,                // situare context
+        NETWORK                     // QNetworkReply context
     };
 }