예제 #1
0
        public void OnException(ExceptionContext context)
        {
            var ex = context.Exception;

            var res = new JsonResult(ex switch
            {
                MemzException memzException => ApiResponse.FromMemzException(memzException),
                Exception exception => ApiResponse.FromError(MemzError.FromException(exception))
            });
예제 #2
0
 public ApiResponse(T data, MemzError error)
 {
     Data  = data;
     Error = error;
 }
예제 #3
0
 public ApiResponse(MemzError err) : this(null, err)
 {
 }