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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:27:12+00:00 2026-05-21T22:27:12+00:00

I am currently doing some research on how to handle exceptions and let the

  • 0

I am currently doing some research on how to handle exceptions and let the client know in a winforms app which calls a WCF service (Self-hosted in a windows service). What is the best way for this? A couple of questions:

1) If I let an exception propagate, it’ll come up on the client side.
2) What’s the best way to catch the exception on the client side? Is it:

catch (FaultException<T> fault) { }

(Empty catch block just for demo purposes). Or is there another way?

  • 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-21T22:27:13+00:00Added an answer on May 21, 2026 at 10:27 pm

    You will need to put each of your calls in a try{}catch{} block since that is where it will be propagated from on the client side, possibly encompassing some of the possible exception handing in some sort of proxy to hide the WCF specific handling.
    Using exception shielding you can also specify custom FaultExceptions and decorate the method with attributes to allow that exception to be sent down to the client. That way you can be a little more intelligent when the exception arises.
    e.g.

        try{
           ... call service
        }catch(FaultException<TimeoutFault> ex){
           .. try one more time
        }catch(FaultException<InvalidSelection> ex){
          ... show message to user from ex.Details.InvalidProperty
        }catch(FaultException){
          ... handle
        }catch (CommunicationException ex){
           ... remember this is WCF so the call itself might fail
        }catch(Exception ex){
         ... handle        
        }
    

    Id reccomend reading http://blogs.msdn.com/b/pedram/archive/2008/01/25/wcf-error-handling-and-some-best-practices.aspx as it has a few good tips/

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

Sidebar

Related Questions

I am currently doing some research which involves analyzing data coming from different sensors.
Currently I'm doing some unit tests which are executed from bash. Unit tests are
I'm currently doing some research for a website design company who wants me to
I've been doing some research on how to globally handle errors in my ASP.NET
I'm currently doing some research on smali/code obfuscator and I'm trying to get familar
I am doing some research on language implementations on multicore platforms. Currently, I am
I'm currently doing some GUI testing on a ASP.net 2.0 application. The RDBMS is
i'm currently doing some reports for SSRS, and i just confirm what i already
I am currently doing some socket programming using C/C++. To be able to use
We're currently doing some Word automation, and want to be able to insert a

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.