                                     }
                                     else
                                     {
-                                        let error = NSError(domain: SessionManager.errorDomain, code: -1, userInfo: [NSLocalizedDescriptionKey:  "Invalid content type"])
+                                        let error = NSError(domain: kErrorDomain, code: -1, userInfo: [NSLocalizedDescriptionKey:  "Invalid content type"])
                                         failedHandler(error)
                                     }
                                 }

                                    }
                                    else
                                    {
                                        let error = NSError(domain: SessionManager.errorDomain, code: -1, userInfo: [NSLocalizedDescriptionKey: "Invalid content type"])
                                        failedHandler(error)
                                    }
                                }
                                else
                                {
                                    let error = NSError(domain: SessionManager.errorDomain, code: -1, userInfo: [NSLocalizedDescriptionKey: "Could not parse response"])
                                    failedHandler(error)
                                }
                            }

        {
            if let error = response["error"] as? String, let description = response["error_description"] as? String
            {
                err = NSError(domain: kErrorDomain, code: errorCode, userInfo: ["error": error, NSLocalizedDescriptionKey: description])
                return err
            }
        }
        
        err = NSError(domain: kErrorDomain, code: errorCode, userInfo: [NSLocalizedDescriptionKey: "Could not parse error response"])
        
        return err
    }
