                 
                 let statusCode = (URLResponse as? NSHTTPURLResponse)?.statusCode ?? 0
                 if !contains(self.acceptableStatusCodeRange, statusCode) {
-                    let userInfo = [NSLocalizedDescriptionKey: "received status code that represents error"]
-                    let error = NSError(domain: APIKitErrorDomain, code: statusCode, userInfo: userInfo)
-                    dispatch_async(mainQueue, { handler(.Failure(Box(error))) })
+                    var error: NSError = {
+                        switch self.responseBodyParser().parseData(data) {
+                        case .Success(let box): return self.responseErrorFromObject(box.unbox)
+                        case .Failure(let box): return box.unbox
+                        }
+                    }()
+
+                    dispatch_async(mainQueue) { handler(failure(error)) }
                     return
                 }
                 

            return nil
        }
    }
    
    // MARK: - NSURLSessionTaskDelegate
    // TODO: add attributes like NS_REQUIRES_SUPER when it is available in future version of Swift.
    public func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError connectionError: NSError?) {

                        let error = NSError(domain: APIKitErrorDomain, code: 0, userInfo: userInfo)
                        return failure(error)
                    }
                }

                dispatch_async(mainQueue, { handler(mappedResponse) })
            }
            
