KAZ Software interview question

Error handling of a code