bit-framework

add exception type to bit framework known exceptions

爷,独闯天下 提交于 2019-12-23 10:15:24
问题 based on docs, there are some known exception types in bit-framework. https://docs.bit-framework.com/docs/bit-server-side/web-api.html#exceptions How can we extend this list? 回答1: Take a look at following code: public class MyException : Exception, IKnownException /*Required*/, IHttpStatusCodeAwareException /*Optional >> Default is InternalServerError (500)*/ { public MyException(string message) : base(message) { } public HttpStatusCode StatusCode { get; set; } = HttpStatusCode.Conflict; }