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)) });
public ApiResponse(T data, MemzError error) { Data = data; Error = error; }
public ApiResponse(MemzError err) : this(null, err) { }