asp.net mvc - Error codes support for our Onion Architecture -
we planning implement our own errorcodes in our asp.net mvc application.
we bundle similar errors . between numbers, within interval described them have similar errors/notifications.
looking similar
http://msdn.microsoft.com/en-us/library/ms681381(vs.85).aspx
what best way of doing ? there patters or industry standards need follow ?
am against idea our requirement!
because mvc application doesn't care error codes produced, go, how they're processed...etc., don't need provide specific implementation handling errors in regards application. it's purely how feel keeping records.
this doing same scenario:
my core service definition:
public interface iexceptionservice { void handle(exception exception); } my infrastructure service implementation:
public sealed class exceptionservice : iexceptionservice { public void handle(exception exception) { /* errors you. */ } } example usage:
private readonly iexceptionservice _exceptionservice; // get's set via ioc. ...
try { /* may throw exception goes here. */ } catch(exception ex) { _exceptionservice.handle(ex); }
Comments
Post a Comment