public void GetEnumDesc(EnumErrorType type) { var res = MethodLib.LogHelper.GetEnumDesc(type); Assert.NotNull(res); Assert.Greater(res.Length, 0); }
/// <summary> /// Display apppropriate error messages for each exception scenarios. /// </summary> /// <param name="errorType"></param> public static void showErrorMessage(EnumErrorType errorType) { switch (errorType) { case EnumErrorType.InvalidZipCodeInput: MessageBox.Show("The Zip code input should be ZIP+4 digits!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case EnumErrorType.InvalidBarCodeInput: MessageBox.Show("The Bar code input should have 52 half/full bars!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case EnumErrorType.IncorrectBarCode: MessageBox.Show("The given Bar Code is incorrect", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case EnumErrorType.IncorrectCheckDigit: MessageBox.Show("The given Bar Code does not compute correctly against the check digit", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case EnumErrorType.OutputBoxIsEmpty: MessageBox.Show("Output box is empty!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } }
protected void ReportError(EnumErrorType overridingStatus, ReturnObject rc, string msg) { if (rc.Status == EnumErrorType.Failure || rc.Status == EnumErrorType.Inconclusive) { throw new BreakExecutionException(rc); } }
public static void HandleError(EnumErrorType type, HttpListenerContext context) { switch (type) { case EnumErrorType.NotFound: error404handler.Handle(context); break; case EnumErrorType.Internal: error500handler.Handle(context); break; default: error500handler.Handle(context); break; } }
static JDFAutoErrorData() { atrInfoTable[0] = new AtrInfoTable(AttributeName.ERRORTYPE, 0x22222222, AttributeInfo.EnumAttributeType.enumeration, EnumErrorType.getEnum(0), null); atrInfoTable[1] = new AtrInfoTable(AttributeName.ERRORURL, 0x33333333, AttributeInfo.EnumAttributeType.URI, null, null); atrInfoTable[2] = new AtrInfoTable(AttributeName.FIXEXPRESSION, 0x33333333, AttributeInfo.EnumAttributeType.Any, null, null); atrInfoTable[3] = new AtrInfoTable(AttributeName.PATH, 0x33333333, AttributeInfo.EnumAttributeType.XPath, null, null); }
/// /// <summary> * (9) get attribute ErrorType </summary> /// * <returns> the value of the attribute </returns> /// public virtual EnumErrorType getErrorType() { return(EnumErrorType.getEnum(getAttribute(AttributeName.ERRORTYPE, null, null))); }
// ************************************************************************ // * Attribute getter / setter // * ************************************************************************ // // --------------------------------------------------------------------- // Methods for Attribute ErrorType // --------------------------------------------------------------------- /// /// <summary> * (5) set attribute ErrorType </summary> /// * <param name="enumVar">: the enumVar to set the attribute to </param> /// public virtual void setErrorType(EnumErrorType enumVar) { setAttribute(AttributeName.ERRORTYPE, enumVar == null ? null : enumVar.getName(), null); }
/// <summary> /// /// </summary> /// <param name="status"></param> public ReturnObject(EnumErrorType status) { this.Status = status; }
static JDFAutoPRError() { atrInfoTable[0] = new AtrInfoTable(AttributeName.ERRORTYPE, 0x22222211, AttributeInfo.EnumAttributeType.enumeration, EnumErrorType.getEnum(0), null); atrInfoTable[1] = new AtrInfoTable(AttributeName.VALUE, 0x22222211, AttributeInfo.EnumAttributeType.NMTOKEN, null, null); }