Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5956371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:14:51+00:00 2026-05-22T18:14:51+00:00

exception handling: what do they actually do. consider the scenario that I am reading

  • 0

exception handling: what do they actually do.

consider the scenario that I am reading a file for input and I want to put try/catch the file opening and reading code within a try/catch clause.
What happens if there is error in reading the file(file doesnt exists etc). The code goes to the catch block, but what should I put in there.

What is the use of catch block, does the catch block suspends the normal running of the program and the program exists after the catch block?

Thanks in advance for clearing these doubts!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:14:52+00:00Added an answer on May 22, 2026 at 6:14 pm

    Since you didn’t provide a specific language, I’m just going to answer as a general concept.

    When an exception is hit, the code will jump to the catch block, skipping over all code between the exception and the catch block.

    There is no general answer to what you should put in the catch. It depends entirely on your specific case. You will often want to log the error somewhere and then take some appropriate action. What an “appropriate action” is can vary greatly. If the code which is failing is initiated by a user, you would want to return some error message to the user. If it is in some sort of nightly job you may want to send an email alerting someone of the problem, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question: Is exception handling in Java actually slow? Conventional wisdom, as well as a
I want to know the global mechanism for exception handling. Like I do have
I am implementing exception handling for our BizTalk services, and have run into a
For testing exception handling in the case of a broken connection it is useful
I know two approaches to Exception handling, lets have a look at them. Contract
Most program languages have some kind of exception handling; some languages have return codes,
I recently read Object Oriented Exception Handling in Perl Perl.com article. Is there any
I've never been completely happy with the way exception handling works, there's a lot
I admit it: I don't bother with too much exception handling. I know I
I've worked in shops where I've implemented Exception Handling into the event log, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.