You can add @ERROR and @SERROR after any/all commands and set those to vars and then write a descriptive log file to a central location if you want as well.