catch and print error from urlopen