Added error catching

I think i added error catching for all errors. Shouldnt have any problems