2013-04-05 70 views
1

我一直在使用ServiceStack一段時間,需要知道是否有可能在拋出異常時自定義ResponseStatus對象。自定義ResponseStatus錯誤代碼屬性

所以我目前得到這樣的迴應:

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

我想使它返回一個自定義錯誤代碼,可能會來自一個枚舉,這樣的更新「錯誤碼」字段:

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

這可能嗎?

回答