For error handling, use the rr postfix completion template. This template combines functionality of two already available templates, rre and rrv. The rr generates a code that checks if an error variable is not nil, then the code exits the function, and returns default values.