Merge "Make error handling more similar for output and capture"