add boilerplate code for location service errors