 
 private let profileExcludes  = ["userid"]
 
-public let UMConsentInfoString = "Retrieved consent"
-public let UMPhotoInfoString   = "Retrieved photo"
-
+public let UMConsentInfoString         = "Retrieved consent"
+public let UMPhotoInfoString           = "Retrieved photo"
+public let UMPullComponentsInfoString  = "Retrieved account components"
+public let UMPullFullAccountInfoString = "Retrieved full account"
+
+// Error generators.
+// These are public to allow other components to recreate and check error messages.
+public let UMPushInvalidBinaryFileError : (AccountComponent, String?) -> String = { (component, path) in
+    return "Invalid \(component) file at: \(path)"
+}
+
+public let UMPushReadBinaryFileError : (AccountComponent, String) -> String = { (component, path) in
+    return "Failed to read \(component) file at: \(path)"
+}
+
+public let UMPullComponentError : AccountComponent -> String = { component in
+    return "Failed to pull account component \(component)"
+}
 
 /**
  This manages the users for Metabolic Compass. We need to enable users to maintain access to their data and to delete themselves from the study if they so desire. In addition we maintain, in this class, the ability to do this securely, using OAuth and our third party authenticator (Stormpath)


    var tokenExpiry : NSTimeInterval = NSDate().timeIntervalSince1970   // Expiry in time interval since 1970.

    private(set) public var profileCache : [String: AnyObject] = [:]                        // Stormpath account dictionary cache.

    // Account component dictionary cache.
    private(set) public var componentCache : [AccountComponent: [String: AnyObject]] = [
        .Consent      : [:],


    init() {
        Stormpath.setUpWithURL(MCRouter.baseURLString)
    }

    // MARK: - Account status, and authentication
