Tie together function calls with optional errors and return the first error