// Token: 0x060012C6 RID: 4806 RVA: 0x0003CD58 File Offset: 0x0003AF58 private void Task_Error(object sender, GenericEventArg <TaskErrorEventArg> e) { if (e.Data.ExceptionHandled) { return; } PswsErrorHandling.SendErrorToClient(PswsErrorCode.CmdletExecutionFailure, e.Data.Exception, null); }
// Token: 0x060012C4 RID: 4804 RVA: 0x0003CB88 File Offset: 0x0003AD88 internal static void SendErrorToClient(PswsErrorCode errorCode, Exception exception, string additionalInfo) { ExTraceGlobals.PublicPluginAPITracer.TraceDebug <PswsErrorCode, Exception, string>(0L, "[PswsErrorHandling.SendErrorToClient] Error Code = {0}, Exception = \"{1}\", additionalInfo = \"{2}\".", errorCode, exception, additionalInfo); try { HttpContext httpContext = HttpContext.Current; if (httpContext != null) { HttpResponse response = httpContext.Response; if (response != null) { if (response.Headers["X-Psws-ErrorCode"] == null) { response.AddHeader("X-Psws-ErrorCode", ((int)PswsErrorHandling.TranslateErrorCode(errorCode, exception, additionalInfo)).ToString()); HttpLogger.SafeSetLogger(ServiceCommonMetadata.ErrorCode, errorCode); if (exception != null) { string text = exception.GetType() + "," + exception.Message; if (text.Length > 500) { text = text.Substring(0, 500 - "...(truncated)".Length); text += "...(truncated)"; } response.AddHeader("X-Psws-Exception", text); HttpLogger.SafeAppendGenericInfo("PswsExceptionInfo", text); } if (!string.IsNullOrWhiteSpace(additionalInfo)) { response.AddHeader("X-Psws-ErrorInfo", additionalInfo); HttpLogger.SafeAppendGenericInfo("PswsErrorAdditionalInfo", additionalInfo); } } } } } catch (Exception ex) { ExTraceGlobals.PublicPluginAPITracer.TraceDebug <Exception>(0L, "[PswsErrorHandling.SendErrorToClient] Exception {0}.", ex); HttpLogger.SafeAppendGenericError("SendErrorToClientError", ex, new Func <Exception, bool>(KnownException.IsUnhandledException)); } }
// Token: 0x060012C2 RID: 4802 RVA: 0x0003CB5E File Offset: 0x0003AD5E public override bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll, out bool?output) { output = null; PswsErrorHandling.SendErrorToClient(PswsErrorCode.CmdletShouldContinue, null, query); return(true); }