public static DialogResult ShowErrorMsg(IWin32Window owner, Exception exception) { try { DialogResult ret = DialogResult.None; string txtError = ""; txtError = string.Format("Fuente del error:\t{0}\nDescripción:\t{1}", exception.Source, exception.Message); DodoException acpError = exception as DodoException; if (acpError == null && exception.InnerException != null) { acpError = exception.InnerException as DodoException; } if (acpError != null) { txtError += "\n\nExcepción DodoNet:"; txtError += "\n________________________________________"; txtError += string.Format("\nLugar del error:\t{0}", acpError.errorLocation); txtError += string.Format("\nTraza del error:\t{0}", acpError.stackTrace); } ret = MessageBox.Show(owner, txtError, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(ret); } catch (Exception err) { throw err; } }
public static DialogResult ShowErrorMsg(string text, IWin32Window owner, Exception exception) { try { DialogResult ret = DialogResult.None; string txtError = ""; txtError = string.Format("{0}\n\n", text); txtError += string.Format("Descripción:\t{1}\nFuente del error:\t{0}", exception.Source, exception.Message); if (exception is DodoException) { DodoException acpError = (DodoException)exception; txtError += "\n\nExcepción DodoNet:"; txtError += "\n________________________________________"; if (acpError.TargetSite != null) { txtError += string.Format("\nMétodo:\t{0}", acpError.TargetSite); } txtError += string.Format("\nLugar del error:\t{0}", acpError.errorLocation); txtError += string.Format("\nTraza del error:\t{0}", acpError.stackTrace); } ret = MessageBox.Show(owner, txtError, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(ret); } catch (Exception err) { throw err; } }
public string targetSiteName; // método que dió el error public OverlayErrorMsg(OverlayRequest request, DodoException exception) : base(request) { error_description = exception.error_description; error_details = exception.error_details; error_code = exception.error_code; error_level = exception.error_level; errorLocation = exception.errorLocation; stackTrace = exception.stackTrace; typeException = exception.typeException; typeRequest = exception.typeRequest; targetSiteName = exception.targetSiteName; }
public Exception GetException() { Exception ret = null; if (typeException != null) { string tmp = String.Format("Happened in {0}. Details: {1} {2} {3}", errorLocation, error_details, error_description, stackTrace); ret = (Exception)Activator.CreateInstance(Type.GetType(typeException, false), new object[] { tmp, new DodoException(this) }); } else { ret = new DodoException(this); } return(ret); }