4

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?

1SaeedSalehi
  • 364
  • 1
  • 8
  • 16

1 Answers1

3

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;
}

Hope this helps

Yaser Moradi
  • 3,267
  • 3
  • 24
  • 50