Service localization

Topics: Exception Handling Application Block
Jun 12, 2008 at 8:43 AM
to get benefit of localization support of ehab, I need to have a different exception types for each message key in my resource file. 
but I think this mustnt be the idea behind having custom exception types.   I mean it must be related to the handing strategies. 
so I want to have my exception types according to my handling ways not message contents. 
what do you think ?
Jun 12, 2008 at 3:59 PM
Hi,

Are you asking about the hability to specify resource types and names for the built in exception handlers? Why would the localization needs drive the existence of custom exceptions? Can you provide a concrete example of how you need to configure the EHAB and how you would use custom exceptions?

Fernando


tusanesen wrote:
to get benefit of localization support of ehab, I need to have a different exception types for each message key in my resource file. 
but I think this mustnt be the idea behind having custom exception types.   I mean it must be related to the handing strategies. 
so I want to have my exception types according to my handling ways not message contents. 
what do you think ?



Jun 12, 2008 at 4:40 PM
under a policy, add a new exception type to tell it what to do when that type of exception appears, in context of that policy.  And add a replace handler for instance, specify the resource type and key to get localized message from the resource.  so now, our policy knows what mesage it has for what type of exception. 

maybe , if I had an option to specify a collection that can hold "messageKey - messageString"  pairs, for each exception type .. then it would be more reasonable.
and I would be able to specify several messages for an exception type.
am I missing something ?
Jun 13, 2008 at 4:44 PM
Hi,

Looks like you want to map exceptions to messages using more than just the exception type, although I don't know what the messsageKey would be in your example.

There is no built in for such a feature, but Tom did something similar to map SQLException error codes to different messages that you can use as a starting point if you want to build your own.

Hope this helps,
Fernando


tusanesen wrote:
under a policy, add a new exception type to tell it what to do when that type of exception appears, in context of that policy.  And add a replace handler for instance, specify the resource type and key to get localized message from the resource.  so now, our policy knows what mesage it has for what type of exception. 

maybe , if I had an option to specify a collection that can hold "messageKey - messageString"  pairs, for each exception type .. then it would be more reasonable.
and I would be able to specify several messages for an exception type.
am I missing something ?