This wrapping seems smelly compared to the nicer Function transformers we use for non error results, but then probably because its a double nesting.