If the output from Phantom contains 'error', return an error