catch an error condition without crashing.