 import AlamofireObjectMapper
 import PromiseKit
 
-//TODO: handle headers.
-
 public enum UnauthorizedCode: String {
     case invalidCredentials = "invalid-credentials",
     expiredAccessToken = "expired-access-token",

                let object = Mapper<T>().map(response.result.value)!
                success(object)
            case 400 :
                error(SDException.BadRequest)
            case 401 :
                if let res = Mapper<SDResponse>().map(response.result.value),
                    let code = res.error?.code,

    invalidAuthorizationHeader = "invalid-authorization-header"
}

public enum BadRequestCode: String {
    case alreadyExists = "already-exists",
    unhandledErrorCode
}

public enum SDException: ErrorType {
    case Unauthorized(code: UnauthorizedCode)
    case Forbidden
