How to get error details in console/log file?