/** * Gets the error level of this buffered source exception. The level of the exception is maximum * error level of all the contained causes. * * <p>The causes that do not specify error level default to <code>ERROR</code> level. Also * source exception without any causes are of level <code>ERROR</code>. * * @see com.vaadin.terminal.ErrorMessage#getErrorLevel() */ public ErrorLevel getErrorLevel() { ErrorLevel level = null; for (int i = 0; i < causes.length; i++) { final ErrorLevel causeLevel = (causes[i] instanceof ErrorMessage) ? ((ErrorMessage) causes[i]).getErrorLevel() : ErrorLevel.ERROR; if (level == null) { level = causeLevel; } else { if (causeLevel.intValue() > level.intValue()) { level = causeLevel; } } } return level == null ? ErrorLevel.ERROR : level; }
/** * Constructor with arguments. * * @param vError virError */ public Error(final virError vError) { this.code = ErrorNumber.values()[vError.code]; this.domain = ErrorDomain.values()[vError.domain]; this.level = ErrorLevel.values()[vError.level]; this.message = vError.message; this.str1 = vError.str1; this.str2 = vError.str2; this.str3 = vError.str3; this.int1 = vError.int1; this.int2 = vError.int2; this.VCP = vError.conn; this.VDP = vError.dom; this.VNP = vError.net; }
public static ErrorLevel max(ErrorLevel e1, ErrorLevel e2) { return e1.ordinal() > e2.ordinal() ? e1 : e2; }
@Override public String toString() { return _errorLevel.toString() + ": " + _description; }