Fallback to err.code when generating the name property