general try catch to show exceptions in error log