Handles all kind of errors