support both stderr and error