normalize error handling throughout the app