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 6123117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:58:40+00:00 2026-05-23T15:58:40+00:00

I am not sure if what I am trying to do is even possible,

  • 0

I am not sure if what I am trying to do is even possible, but I figure there must be some work around for it. Assume two routines; routine A and routine B. Both routines A, and B have their own try-catch statements. Routine A will call routine B (shown below), and if routine B encounters some error, routine A will be notified of it.

Here is my example:

// Routine A
private void button13_Click(object sender, EventArgs e)
{
    try
    {
        somevoid();
    }
    catch(Exception ex)
    {
        Console.WriteLine(ex.message); // Never makes it here ...
    }
}

// Routine B
private void somevoid()
{
    try
    {
        int i = 1;
        int z = 0;
        int g = i / z;
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.Message);
    }
}
  • 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-23T15:58:41+00:00Added an answer on May 23, 2026 at 3:58 pm

    I am not sure what you want to achieve, but it seems, you need to catch the exception in both try catch blocks. If so, change your code as follows:

    private void somevoid()
            {
    
                try
                {
                    int i = 1;
                    int z = 0;
                    int g = i / z;
                }
    
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    throw;
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure if what I'm even trying to do is possible but here
Not sure if this is even possible but I am trying to save text
I'm not sure if this is even possible, but I am trying to do
I'm not sure if this is even possible after trying to figure it out
I'm not even sure what this is called? But I'm trying to learn what
Not sure if what I am trying is possible or not, but I'd like
I'm not sure if this is even possible, but I figured I'd ask before
I'm not even sure if this is possible, but I've exhausted all of my
Im not sure how I can achieve this or if its even possible but
Not sure if this is even possible, but I think it's worth asking. What

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.