 passing the unwrapped error as a parameter.</p>

<p>Use the <code>flatMapError</code> function with a closure that may throw an error. For example:</p>
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">possibleData</span><span class="p">:</span> <span class="kt">DataResponse</span><span class="o">&lt;</span><span class="kt">Data</span><span class="o">&gt;</span> <span class="o">=</span> <span class="o">...</span>
<span class="k">let</span> <span class="nv">possibleObject</span>