Changed standard output stream to error stream in exception handling.