handle unprepared error