SDammann.WebApi.Versioning icon indicating copy to clipboard operation
SDammann.WebApi.Versioning copied to clipboard

Configurable error messages

Open MiguelTVMS opened this issue 10 years ago • 3 comments

The error messages generated by the VersionedControllerSelector class could be configurable. I think the message "The API 'Version2_2.values' doesn't exist" exposes to much information. if we where able to supress this message by just showing the common Not Found or configure our messages by setting those in the web.config would be nice.

MiguelTVMS avatar Feb 27 '15 20:02 MiguelTVMS

I'm going to implement the proposal mentioned in #42. This would allow you to do this by implementing your own exception handler to handle such exceptions yourself.

Sebazzz avatar Feb 28 '15 09:02 Sebazzz

Better then my idea. Fantastic. Thanks

MiguelTVMS avatar Feb 28 '15 13:02 MiguelTVMS

In beta3, just pushed to nuget.org, you may either implement your own global exception filter or inherit from DefaultVersioningExceptionHandler and register IVersioningExceptionHandler with your DI container.

Sebazzz avatar Mar 01 '15 09:03 Sebazzz