Enhance error handling utility function.
Check utility error handling logic.