Generalized error handling while opening url