     ///   - handler: closure that recieves serialized response
     /// - Returns: Single on caller
     func handleMappingError<T: Decodable>(with decoder: JSONDecoder = JSONDecoder(),
-                                          handler: @escaping (T?) -> ()) -> PrimitiveSequence<Trait, Element> {
+                                          handler: @escaping ParameterClosure<T>) -> PrimitiveSequence<Trait, Element> {
             return self.do(onError: { error in
-                let mappingModel: T? = error.handleMappingError(with: decoder)
+                guard let mappingModel = try error.handleMappingError(with: decoder) as T? else {
+                    return
+                }
+
                 handler(mappingModel)
             })
     }

    ///   - handler: closure that recieves serialized response
    /// - Returns: Observable on caller
    func handleMappingError<T: Decodable>(with decoder: JSONDecoder = JSONDecoder(),
                                          handler: @escaping (T?) -> ()) -> Observable<E> {
            return self.do(onError: { error in
                let mappingModel: T? = error.handleMappingError(with: decoder)
                handler(mappingModel)
            })
    }

    ///
    /// - Parameter decoder: json decoder to decode response data
    /// - Returns: optional target object
    func handleMappingError<T: Decodable>(with decoder: JSONDecoder = JSONDecoder()) throws -> T? {
        guard let self = requestError, case .mapping(_, let response) = self else {
            return nil
        }

        return try decoder.decode(T.self, from: response)
    }
}

