Make improvements to error handler and config option to show error log