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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:40:52+00:00 2026-05-16T04:40:52+00:00

I have an aspx page that, on a button click, creates an instance of

  • 0

I have an aspx page that, on a button click, creates an instance of a serviceRefernece object. In the code behind for my page I have the call wrapped in a try/catch.

        try
        {
            var client = GetClient();
            var request = new ActiveVerificationRequestDC();
            var response = client.GetActiveVerification(request);
            DoSomethingWithTheResponse(response);      

        }
        catch (FaultException ex)
        {
            LogError(ex, MethodBase.GetCurrentMethod().Name);
            throw;

        }
        catch (Exception ex)
        {
            var args = new[] { MethodBase.GetCurrentMethod().Name, ex.Message };
            DisplayError(args);
        }

The svc file that is referenced is using pretty much the same pattern. It is calling an internal client over net.tcp. The call is wrapped in a try/catch

        try
        {
            var client = new InternalServiceClient();
            var response = client.GetActiveVerification(request);
            client.Close();
            return response;

        }
        catch (FaultException fe)
        {
            LogError(MethodBase.GetCurrentMethod().Name, fe);
            throw; 
        }

Here is my problem, how do I get errors here to bubble up to my UI catch statement? When I leave it like this, I get an unhandled exception error from visual studio. I have tried removing the throw which makes me specify a return value, and I return null. This makes the UI not work correctly. I have tried throw new Exception(fe.message) and I get the same problem with the unhandled exception. Basically my question is how can I accomplish what I need? What am I missing?

  • 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-16T04:40:53+00:00Added an answer on May 16, 2026 at 4:40 am

    You need a separate try/catch block around your try/catch block. You have it such that you will catch a FaultException and any type of Exception, but your Exception block will not catch your throw from FaultException. So, just enclose this with another try/catch or handle it within both the FaultException catch and the Exception catch.

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

Sidebar

Ask A Question

Stats

  • Questions 495k
  • Answers 495k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can't use an open generic type as a generic… May 16, 2026 at 11:26 am
  • Editorial Team
    Editorial Team added an answer You can do it using .prev() and .find() or .children(),… May 16, 2026 at 11:26 am
  • Editorial Team
    Editorial Team added an answer This is a known problem of VS 2010. According to… May 16, 2026 at 11:26 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have an aspx page that on a button click creates a BackgroundWorker and
I have an Index.aspx page with a button. If you click the button a
I have an aspx page that has a control which serves as a summary
i have some header tabs on a basic index.aspx page that uses a masterpage.
Let's say I have a page view called PagePreview.aspx . on that page I've
I have the following code in front that gives a bit of blurb and
Im getting that error when try to call a __doPostBack on one of my
I have iframe that works at the server side : <iframe frameborder=0 runat=server style=width:
I'm using the AutoCompleteExtender from the AJAX control toolkit on my aspx page -
I have a web method in one of my aspx pages: [WebMethod] public static

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.