sane error handling