Questions tagged [ierrorhandler]

In .NET, allows an implementer to control the fault message returned to the caller from a WCF service and optionally perform custom error processing such as logging.

According to MSDN:

Allows an implementer to control the fault message returned to the caller and optionally perform custom error processing such as logging.

It can provide a centralized location for responding to exceptions generated in a WCF service. Typically used to implement detailed logging of errors and/or customization of the information that is returned to the caller via a FaultException.

67 questions
24
votes
2 answers

IErrorHandler doesn't seem to be handling my errors in WCF .. any ideas?

Have been reading around on IErrorHandler and want to go the config route. so, I have read the following in an attempt to implement it. MSDN Keyvan Nayyeri blog about the type defintion Rory Primrose Blog This is basically just the msdn example…
John Nicholas
  • 4,778
  • 4
  • 31
  • 50
12
votes
2 answers

How to setup up web.config for WCF IErrorhandler

Can't integrate IErrorHandler into my project with the correct web.config I have a successfully working WCF that is being consumed by webclients in .net 4 but when trying to setup IErrorhandler as a global error logger as a catch all for all my…
fractal
  • 1,649
  • 17
  • 31
10
votes
1 answer

Injecting dependencies into an IErrorHandler implementation

I am implementing IErrorHandler in order to centralize all of the error handling for my WCF service in one place. This works fairly well: public class ServiceErrorHandler : IErrorHandler { public bool HandleError(Exception error) { …
zimdanen
  • 5,508
  • 7
  • 44
  • 89
9
votes
2 answers

How to capture error message from third-party-library in Lua?

I have adopted the LuaJSON to parse JSON. The parse call seems like that: -- file.lua local res = json.decode.decode(json_str) if res == nil then throw('invalid JSON') end ... But if the json_str is badly formated, the decode() will stop within…
coanor
  • 3,746
  • 4
  • 50
  • 67
8
votes
3 answers

IErrorHandler returning wrong message body when HTTP status code is 401 Unauthorized

I have implemented IErrorHandler to handle authorization exceptions thrown within the constructor of my restful WCF service. When a general exception is caught my custom type is returned as expected, but the ContentType header is incorrect. HTTP/1.1…
John Meyer
  • 2,296
  • 1
  • 31
  • 39
7
votes
2 answers

WCF: provide generic FaultException in IErrorHandler

Some context: We have a custom XSD and generate the WSDL and C# code using WSCF.blue. The client side uses ChannelFactory and shares the interface which includes all the attributes added by WSCF.blue to match what is in the XSD. I'm trying to…
Nelson Rothermel
  • 9,436
  • 8
  • 62
  • 81
7
votes
3 answers

WCF exception handling using IErrorHandler

I am basically implementing the IErrorHandler interface to catch all kinds of exceptions from the WCF service and sending it to the client by implementing the ProvideFault method. I am facing one critical issue however. All of the exceptions are…
p0lAris
  • 4,750
  • 8
  • 45
  • 80
7
votes
2 answers

Implementing WCF IErrorHandler for logging only

Probably trivial question.. I want to implement my own error handler to log errors and monitor what's going on. At this point I don't want to provide my own faults to the clients. I want it to be transparent - just like default WCF behavior. How…
katit
  • 17,375
  • 35
  • 128
  • 256
5
votes
1 answer

ServiceBehavior for WCF REST

I have a problem configuring a ServiceBehavior for my WCF service. Some background. Basically I am developing a REST service WCF that is supposed to run on IIS. I need to be able to log exceptions thrown by the service (I'm using log4net) and…
4
votes
1 answer

WCF IErrorHandler.ProvideFault() behavior

My service methods are marked with PrincipalPermissionAttribute and i have a custom IErrorHandler implementation attached to the service. When an incoming request has no permissions to execute the method System.Security.SecurityException is thrown.…
UserControl
  • 14,766
  • 20
  • 100
  • 187
4
votes
1 answer

Castle Windsor - Injecting logger into IErrorHandler

Am using Castle windsor 3.0 in my Wcf services project. I'm hosting it as windows service project using Topshelf. All my wcf services configuration is on app.config file. I'm using castle wcffacility and registering services like this…
Sai
  • 629
  • 1
  • 8
  • 26
4
votes
3 answers

WCF Error Handling without fault contract

I have a WCF service which all operations return type is OperationStatus: [DataContract] public abstract class ServiceResponse { [DataMember] public bool Success { get; set; } [DataMember] public String StatusReason { get; set;…
mgamer
  • 13,580
  • 25
  • 87
  • 145
4
votes
0 answers

How can I inject an object into an WCF IErrorHandler implementation with Castle Windsor?

I'm developing a set of services using WCF. The application is doing dependency injection with Castle Windsor. I've added an IErrorHandler implementation that is added to services via an attribute. Everything is working thus far. The IErrorHandler…
Michael Johnson
  • 2,287
  • 16
  • 21
4
votes
2 answers

WCF exception IErrorHandler not getting called

I seem to be having a problem for getting IErrorHandler interface to work. My code is using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.ServiceModel; using…
iefpw
  • 6,816
  • 15
  • 55
  • 79
3
votes
1 answer

IErrorHandler not being binded, and not handling error

I have a WCF service, and I have a FaultContract with an IErrorHandler binded to it, and it was working great. For some reason, that I don't know, it stopped being binded at runtime. When I place breakpoints on ApplyDispatchBehavior and Validate,…
Pascal
  • 2,944
  • 7
  • 49
  • 78
1
2 3 4 5