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

  • SEARCH
  • Home
  • 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 6935779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:08:50+00:00 2026-05-27T12:08:50+00:00

I want to execute a bunch of commands which throw exceptions but I’m having

  • 0

I want to execute a bunch of commands which throw exceptions but I’m having problems with the program executing properly.

This is the basic outline of my code:

try
{
   command1 //all three throw exceptions
   command2
   command3
}
catch (Exception e)
{
   //log the exception in a txt file and continue onto the next command
}

If command1 throws an exception, how do I get my program to move onto command2? In other words, how do I get back to the try-block and continue executing from where it left off? Thanks.

  • 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-27T12:08:51+00:00Added an answer on May 27, 2026 at 12:08 pm

    You can never get back into the try block once you’re in the catch block. You’d have to make three blocks to continue executing.

    try { command1(); }
    catch (Exception e) { log(e);  }
    try { command2(); }
    catch (Exception e) { log(e);  }
    try { command3(); }
    catch (Exception e) { log(e);  }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have my program execute a bunch of commands on load-time and
I want to execute a program which takes in 1 text file(say like Text.exe),
i want to execute some commands using NSIS script , but for the commands
I want to execute a code helloword.cpp which takes in some argument from console
I want to execute a program in memory on Windows. I do not want
Can anyone please help me? I am having bunch of .sql files. I want
So I want to first execute a bunch of code, and then ask the
I have asp.net generated html code. I want execute jQuery click function when user
I want to execute an application (executable ending with an .exe extension ) that
I want to execute a javascript on already loaded webpage in Webview. I am

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.