2013-04-05 68 views
1

我一直在使用ServiceStack一段时间,需要知道是否有可能在抛出异常时自定义ResponseStatus对象。自定义ResponseStatus错误代码属性

所以我目前得到这样的回应:

{"responseStatus":{"errorCode":"PasswordNotValidException", 
"message":"User Defined Error","errors":[]}} 

我想使它返回一个自定义错误代码,可能会来自一个枚举,这样的更新“错误码”字段:

{"responseStatus":{"errorCode":"PasswordNotValid", 
"message":"User Defined Error","errors":[]}} 

这可能吗?

回答