Catch errors on code load