I do not know about health monitoring, but usually I have a common shell that executes endpoint code inside. This writes a real exception, but always generates a general exception across the border.
public static T wrapAjaxRequestsToCatchException<T>(Func<T> wrappedDelegate) where T : JsonBase, new() { try { return wrappedDelegate(); } catch (Exception ex) { var errResponse = new T() { Success = false, Message = getErrorMessage(ex) };
source share