Use puts rather than error to output error to ensure it works effectively standalone