Improve error handling in whitelistRecord.go