Better error handling

@tanghus @DeepDiver1975 @MTGap @Raydiation @zimba12 @karlitschek @kabum @Kondou-ger