      Adds a handler to be called once the request has finished.
  
      - parameter queue: The queue to use.
+     - parameter dataToError: A function that interprets an error model to produce an NSError.
      - parameter path: 0 or more `String` or `Int` that subscript the `JSON`.
      - parameter completionHandler: The code to be executed once the request has finished.
      */
     internal func responseObject<T: JSONDecodable>(
         queue queue: dispatch_queue_t? = nil,
+        dataToError: (NSData -> NSError?)? = nil,
         path: [JSONPathType]? = nil,
         completionHandler: Response<T, NSError> -> Void)
         -> Self
     {
         return response(
             queue: queue,
-            responseSerializer: Request.ObjectSerializer(path),
+            responseSerializer: Request.ObjectSerializer(dataToError, path: path),
             completionHandler: completionHandler
         )
     }

     Creates a response serializer that returns an array of objects of the given type
     initialized from JSON response data.

     - returns: An object response serializer.
     */
    internal static func ArraySerializer<T: JSONDecodable>(
        path: [JSONPathType]? = nil)
        -> ResponseSerializer<[T], NSError>
    {


import Foundation
import Alamofire
