Update error handling with string templates