Examples of ErrorCode


Examples of org.xmlBlaster.util.def.ErrorCode

         exceptionFromServer = new Boolean(new String(data, start, end-start));
      }
      catch (java.lang.StringIndexOutOfBoundsException e) {
         log.severe("Receiving invalid format for XmlBlasterException in '" + new String(data) + "'");
      }
      ErrorCode errorCode = (fallback == null) ? ErrorCode.INTERNAL_UNKNOWN : fallback;
      try {
         errorCode = ErrorCode.toErrorCode(errorCodeStr);
      }
      catch (Throwable e) {
         log.severe("Receiving invalid errorCode in XmlBlasterException in '" + new String(data) + "', handling it as " + errorCode.toString());
         message = "Receiving invalid errorCode in XmlBlasterException: Can't parse XmlBlasterException in method parseByteArr(). original message is '" + new String(data) + "'";
      }
      Timestamp ti = new Timestamp();
      try {
         ti = Timestamp.valueOf(timestampStr);
View Full Code Here

Examples of org.xmlBlaster.util.def.ErrorCode

               timeout, userData, this.timerKey);
      }
   }

   private boolean isAuthenticationException(XmlBlasterException ex) {
           ErrorCode code = ex.getErrorCode();
           if (code == null)
                   return false;
           return code.isOfType(ErrorCode.USER_SECURITY_AUTHENTICATION);
   }
View Full Code Here

Examples of org.xmlBlaster.util.def.ErrorCode

         buf.append("cause (ex): '").append(e.getCause()).append("'\n");
      buf.append("localizedMessage: '").append(e.getLocalizedMessage()).append("'");
      buf.append("message: '").append(e.getMessage()).append("'");
      buf.append("toString: '").append(e.toString()).append("'");
      log.severe(buf.toString());
      ErrorCode errCode = ErrorCode.COMMUNICATION_NOCONNECTION;
      int code = e.code;
      if (code >= 400 && code < 500 && code != 408)
         errCode = ErrorCode.USER_MESSAGE_INVALID;
      return extractXmlBlasterException(glob, e, errCode, txt);
   }
View Full Code Here

Examples of org.xmlBlaster.util.def.ErrorCode

   public static XmlBlasterException extractXmlBlasterException(Global glob, XmlRpcException e, ErrorCode fallback, String txt) {
      XmlBlasterException ex = null;
      if (e.linkedException != null && e.linkedException instanceof XmlBlasterException) {
         // since the xmlBlaster Exception here is an empty one (no global and stuff) we fill it again
         XmlBlasterException emptyEx = (XmlBlasterException)e.linkedException;
         ErrorCode code = ErrorCode.toErrorCode(emptyEx.getErrorCodeStr());
        
         Throwable cause = e.getCause();
         if (cause != null) {
            if (cause instanceof XmlBlasterException) {
               if (cause == emptyEx) {
View Full Code Here

Examples of org.xmlBlaster.util.def.ErrorCode

      MsgUnitRaw msg = (MsgUnitRaw) msgVec.elementAt(0);
     
      if (msg.getContent() == null || msg.getContent().length == 0) {
         // For example when using XmlInterpreter
         // <qos><state id='ERROR' info='communication'/></qos>
         ErrorCode errorCode = ErrorCode.INTERNAL; // default setting
         try{
            // See serialization in XmlScriptInterpreter.java
            StatusQosData data = glob.getStatusQosFactory().readObject(msg.getQos());
            errorCode = ErrorCode.toErrorCode(data.getStateInfo());
         }
View Full Code Here

Examples of restx.exceptions.ErrorCode

    @Override
    protected boolean processImpl(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws Exception{
        for (Element elem : roundEnv.getElementsAnnotatedWith(ErrorCode.class)) {
            try {
                ErrorCode errorCode = elem.getAnnotation(ErrorCode.class);
                TypeElement typeElement = (TypeElement) elem;

                String fqcn = typeElement.getQualifiedName().toString();
                int i = CharMatcher.JAVA_UPPER_CASE.indexIn(fqcn);
                String pack = fqcn.substring(0, i - 1);
                String name = fqcn.substring(i).replace(".", "");
                String descriptor = name + "Descriptor";

                List<String> fields = Lists.newArrayList();
                for (Element element : typeElement.getEnclosedElements()) {
                    if (element.getKind() == ElementKind.ENUM_CONSTANT) {
                        String field = element.getSimpleName().toString();
                        ErrorField errorField = element.getAnnotation(ErrorField.class);
                        String description = errorField == null ? field.replace("_", " ").toLowerCase(Locale.ENGLISH)
                                : errorField.value();
                        fields.add(String.format(".put(\"%s\", new ErrorDescriptor.ErrorFieldDescriptor(\"%s\", \"%s\"))",
                                field, field, description));
                    }
                }

                ImmutableMap<String, Object> ctx = ImmutableMap.<String, Object>builder()
                        .put("package", pack)
                        .put("descriptor", descriptor)
                        .put("errorStatus", String.valueOf(errorCode.status().getCode()))
                        .put("errorCode", errorCode.code())
                        .put("description", errorCode.description())
                        .put("fields", Joiner.on("\n").join(fields)).build();


                generateJavaClass(pack + "." + descriptor, errorDescriptorTpl, ctx, elem);
            } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.