Example #1
0
        public virtual IHttpActionResult CheckRequestSuspendedByDebugger(string requestToken)
        {
            AppInfo   appInfo = null;
            HeContext context = null;

            try {
                appInfo = AppInfo.GetAppInfo();
                if (appInfo == null || !appInfo.IsApplicationEnabled)
                {
                    return(GetErrorResponseResult("Application Backend Unavailable", HttpStatusCode.ServiceUnavailable));
                }

                ValidateRequestSecurity();

                context = appInfo.OsContext;

                var isRequestSupended = DebuggerHelper.HasSuspendedThreadWithRequestToken(requestToken);
                return(GetResponseResult(typeof(bool), isRequestSupended));
            } catch (Exception ex) {
                DatabaseAccess.FreeupResources(false);

                var licensingException = ex as LicensingException;
                if (licensingException != null)
                {
                    return(GetErrorResponseResult("Application Backend Unavailable", HttpStatusCode.ServiceUnavailable));
                }

                var exposeRestException = ex as ExposeRestException;
                if (exposeRestException != null)
                {
                    ErrorLog.LogApplicationError(exposeRestException, appInfo, context, "Module Services");
                    return(GetErrorResponseResult(exposeRestException.Message, exposeRestException.StatusCode));
                }

                ErrorLog.LogApplicationError(ex, appInfo, context, "Module Services");
                return(GetErrorResponseResult("Internal Server Error", HttpStatusCode.InternalServerError));
            }
        }