Add Exception to Known Bit Frames

based on documents, there are some well-known types of exceptions in the bit structure.

https://docs.bit-framework.com/docs/bit-server-side/web-api.html#exceptions

How can we expand this list?

+4
source share
1 answer

Take a look at the 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

+1
source

Source: https://habr.com/ru/post/1685617/


All Articles