AlamofireObjectMapper responseObject method migrating issue
<p>I have a problem with the <code>AlamofireObjectMapper</code> <code>responseObject</code> method. It's <code>completionHandler</code> changed from <code>Response&lt;T, NSError&gt; -&gt; Void</code> (old) to <code>DataResponse&lt;T&gt; -&gt; Void</code> (now). Maybe I don't get it but can you please tell me how can I provide backend error handling now with this change? Before, I had in completion for example <code>Response&lt;Object, NSError&gt;</code>. Now I can't handle both the backend error and the on success received data. Or should I use other approach? </p>

<p>For example now I have: Xcode 8 , swift 3, updated frameworks</p>

<pre><code>class func getAllProducts(successCallBack:((ProductsData?) -&gt; Void), failureCallBack: ((NSError?, ServerResponseStatusCode?) -&gt; Void)?) {

        Alamofire.request(URLRouter.Products).responseObject {
            (response: DataResponse&lt;ProductsData, NSError&gt;) in

            // inside completion block code
        }
    }
</code></pre>

<p>But as I checked in the new updated AlamofireObjectMapper, this method's completion now is of form <code>DataResponse&lt;T&gt;</code> only, and because of this I get the error "Generic type "DataResponse" specialized with too many type parameters(got 2 but expected 1)"</p>

<p>Before: working Xcode 7, swift 2.2</p>

<pre><code>class func getAllProducts(successCallBack:((ProductsData?) -&gt; Void), failureCallBack: ((NSError?, ServerResponseStatusCode?) -&gt; Void)?) {

        Alamofire.request(URLRouter.Products).responseObject {
            (response: Response&lt;ProductsData, NSError&gt;) in

            // inside completion block code
        }
    }
</code></pre>

<p>Thank you very much.</p>