Add error utility function.