add getErrorStream function for error stream.