in reply to How to capture error messages...

Safe cross-platform command execution and capture of STDOUT & STDERR
How can I capture STDERR from an external command?
How to capture STDOUT/STDERR of a function