#python #JeroendeVries Owner Jeroen de Vries Website

Logging van de library

YouTube [[Error Handling#^1afd71]]

Zonder error handling

r = requests.get(
	url='http://url.com',
	)
return r

Met error handling

try:
	r = requests.get(
		url='http://url.com',
	)
	r.raise_for_status()
except exceptions.RequestException as err:
	# Handel hier de Request errors af
return r

Error logging

try:
	r = requests.get(
		url='http://url.com',
	)
	r.raise_for_status()
except exceptions.RequestException as err:
	# Handel hier de Request errors af
return r