Examples of OperationException


Examples of cascading.operation.OperationException

      value = "";

    Matcher matcher = functionCall.getContext().getLhs().reset( value );

    if( !matcher.find() )
      throw new OperationException( "could not match pattern: [" + getPatternString() + "] with value: [" + value + "]" );

    Tuple output = functionCall.getContext().getRhs();

    output.clear();
View Full Code Here

Examples of co.cask.cdap.data2.OperationException

      hTable.increment(increment);
    } catch (IOException e) {
      // figure out whether this is an illegal increment
      // currently there is not other way to extract that from the HBase exception than string match
      if (e.getMessage() != null && e.getMessage().contains("isn't 64 bits wide")) {
        throw new OperationException(StatusCode.ILLEGAL_INCREMENT, e.getMessage(), e);
      }
      throw e;
    }
    hTable.flushCommits();
  }
View Full Code Here

Examples of com.im.imjutil.exception.OperationException

        KeyGenerator kgen = KeyGenerator.getInstance(type.cipher);
        SecretKey skey = kgen.generateKey();
        return skey.getEncoded();
       
    } catch (Exception e) {
      throw new OperationException(Convert.toString(
          e.getClass().getName(), " -> ", e.getMessage()), e);
    }
  }
View Full Code Here

Examples of com.netflix.astyanax.connectionpool.exceptions.OperationException

        do {
          try {
                return executeOp();
            } catch (RuntimeException ex) {
              lastException = new OperationException(ex);
            } catch (ConnectionException ex) {
                if (ex instanceof IsRetryableException)
                    lastException = ex;
                else
                    throw ex;
View Full Code Here

Examples of com.netflix.jmeter.sampler.OperationException

                new Writer(client, wConsistecy, cfName).insert(rKey, name, val);
            }
        }
        catch (Exception e)
        {
            throw new OperationException(e);
        }
        return new ResponseData("", 0, client.host, 0, key, colName, value);
    }
View Full Code Here

Examples of com.salesforce.dataloader.exception.OperationException

        headers.add(Config.ERROR_COLUMN_NAME);
        try {
            getErrorWriter().open();
            getErrorWriter().setColumnNames(headers);
        } catch (final DataAccessObjectInitializationException e) {
            throw new OperationException(
                    getMessage("errorOpeningErrorFile", getConfig().getString(Config.OUTPUT_ERROR)), e);
        }
    }
View Full Code Here

Examples of com.taobao.eclipse.plugin.reviewboard.core.exception.OperationException

                }
            }
        }
        if(!isSuccess){
            if(!reviewboardReader.getErrorCode(resultContent).equals( UPLOADTOSERVER_FAIL_FILE_CODE )){
                throw new OperationException("Error When Uploading Diff for review_request_id = "+ reviewRequestId
                        +", error information is:" + reviewboardReader.getErrorMessage(resultContent)
                        +",the resultContent from the server is:"+resultContent);
            }else{
                DiffUploadErrorBean diffUploadErrorBean = reviewboardReader.getDiffUploadErrorBean(resultContent);
                StringBuilder errorInfoSB = new StringBuilder();
                errorInfoSB.append("review_request_id = "+ reviewRequestId +"的Request在上传diff时,出现错误,错误原因一般是因为下面之一:");
                errorInfoSB.append(System.getProperty("line.separator"));
                errorInfoSB.append("(1)请仔细检查本地的SVN版本和文件,以及上传时指定的Base Directory");
                errorInfoSB.append(System.getProperty("line.separator"));
                errorInfoSB.append("(2)您不具备该目录的SVN权限;或者您在ReviewBoard服务器尚未配置该目录;");
                errorInfoSB.append(System.getProperty("line.separator"));
                errorInfoSB.append("服务器端返回的错误详情:ReviewBoard服务器找不到SVN文件:"
                        + diffUploadErrorBean.getFile()+",revision="+diffUploadErrorBean.getRevision());
                throw new OperationException(errorInfoSB.toString());
            }
        }
    }
View Full Code Here

Examples of entagged.tageditor.exceptions.OperationException

    }

    protected void directoryAction(java.util.List files)
        throws OperationException {
      if (files.size() <= 2)
        throw new OperationException(
            "Not enough files to create a good FreedbID, skipping");

      // Sort the files in this album
      Collections.sort(files, new Comparator() {
        public int compare(Object a, Object b) {
          File fa = (File) a;
          File fb = (File) b;
          return fa.getName().compareToIgnoreCase(fb.getName());
        }
      });

      // Creates the album to be used by freedb
      float[] f = new float[files.size()];
      Iterator it = files.iterator();
      int i = 0;
      while (it.hasNext()) {
        f[i] = ((AudioFile) it.next()).getPreciseLength();
        i++;
      }

      // Connect to freedb
      FreedbReadResult[] fdbresults = null;
      try {
        FreedbQueryResult[] fdbqr = freedb.query(f);

        System.out.println(LangageManager.getProperty(
            "freedb.searchsuccessful").replaceAll("%1",
            new Integer(fdbqr.length).toString()));
        System.out.println("\t"
            + LangageManager.getProperty("freedb.readingresults"));

        int maxResults = (fdbqr.length > MAX_RESULTS) ? MAX_RESULTS
            : fdbqr.length;
        fdbresults = new FreedbReadResult[maxResults];

        for (int h = 0; h < maxResults; h++) {
          fdbresults[h] = freedb.read(fdbqr[h]);
          System.out
              .println("\t"
                  + LangageManager.getProperty(
                      "freedb.resultof").replaceAll("%1",
                      new Integer(h + 1).toString())
                      .replaceAll(
                          "%2",
                          new Integer(fdbqr.length)
                              .toString())
                      .replaceAll(
                          "%3",
                          new Integer((h + 1) * 100
                              / fdbqr.length)
                              .toString()));
        }
      } catch (FreedbException ex) {
        System.out.println(LangageManager
            .getProperty("freedb.noresult"));
        throw new OperationException(ex.getMessage());
      }

      // Write the tag-------------
      // Select the best result, rely on the comparable interface for
      // readresults
      Arrays.sort(fdbresults);
      FreedbReadResult fdbrr = fdbresults[fdbresults.length - 1];

      it = files.iterator();
      i = 0;
      while (it.hasNext()) {
        AudioFile af = (AudioFile) it.next();

        Tag tag = af.getTag();
        tag.setTitle(fdbrr.getTrackTitle(i).trim());
        tag.setAlbum(fdbrr.getAlbum().trim());
        tag.setGenre(fdbrr.getGenre().trim());
        tag.setArtist(fdbrr.getArtist().trim());
        tag.setYear(fdbrr.getYear().trim());
        tag.setComment(fdbrr.getAlbumComment().trim());
        tag.setTrack(new DecimalFormat("00").format(i + 1));

        if (tag instanceof Id3v2Tag)
          tag.setEncoding(PreferencesManager
              .get("entagged.tag.encoding"));

        try {
          AudioFileIO.write(af);
        } catch (CannotWriteException e) {
          throw new OperationException(
              "Album skipped after this file: " + e.getMessage());
        }
        i++;
      }
    }
View Full Code Here

Examples of entagged.tageditor.exceptions.OperationException

            int filei = filename.lastIndexOf(fields[i][0]);
            int diri = directory.lastIndexOf(fields[i][0]);

            if ((filename.indexOf(fields[i][0]) != filei)
                    || (directory.indexOf(fields[i][0]) != diri)) {
                throw new OperationException("Cannot have two \""
                        + fields[i][0] + "\" masks in the same pattern");
            }

            if (filei != -1 && diri != -1) {
                throw new OperationException("Cannot have two \""
                        + fields[i][0]
                        + "\" masks in both filename and directory pattern");
            }

            filenameHash.put(new Integer(filei), new Integer(i));

            directoryHash.put(new Integer(diri), new Integer(i));
        }

        directory = replaceReservedRegexCharacters(directory);
        filename = replaceReservedRegexCharacters(filename);

        for (int i = 0; i < fields.length; i++) {
            if (fields[i][0].equals(IGNORE_MASK)) {
                filename = filename.replaceAll(fields[i][0], "(.+)");
                directory = directory.replaceAll(fields[i][0], "(.+)");
            } else {
                filename = filename.replaceAll(fields[i][0], "(.+?)");
                directory = directory.replaceAll(fields[i][0], "(.+?)");
            }

        }

        filename = filename + "." + extension;
        if (directory.endsWith(File.separator))
            directory = directory.substring(0, directory.length()
                    - File.separator.length());

        // Filename pattern matching ------------------------------------------
        System.out.println("Matching:\n" + f.getName() + "\nagainst:\n"
                + filename);
        Pattern pa = Pattern.compile(filename);
        Matcher ma = pa.matcher(f.getName().toLowerCase());

        int length = 0;
        if (ma.matches()) {
            for (int i = 1; i <= ma.groupCount(); i++) {
                // we can find a group that is not in the hashtable, if the user
                // entered %1-%1, for ex.
                // We work only with multiple ignore masks, not other..
                Integer pos = (Integer) filenameHash.get(new Integer(ma
                        .start(i)
                        + length));
                if (pos != null) {
                    fields[pos.intValue()][1] = ma.group(i);
                    System.out.println("Match " + i + ": " + ma.group(i));
                    length = length - ma.group(i).length()
                            + fields[pos.intValue()][0].length();
                } else {
                    // It was an ignore mask ok, or a double mask then we will
                    // fail
                    length = length - ma.group(i).length()
                            + fields[7][0].length();
                }
            }
        } else
            throw new OperationException(LangageManager
                    .getProperty("opex.fpattern"));
        // Filename matching finished
        // ---------------------------------------------------------------------

        // Directory name pattern
        // matching--------------------------------------------------------------
        System.out.println("Matching:\n" + f.getParentFile().getPath()
                + "\nagainst:\n" + directory);
        pa = Pattern.compile(directory);
        ma = pa.matcher(f.getParent().toLowerCase());

        length = 0;
        if (ma.matches()) {
            for (int i = 1; i <= ma.groupCount(); i++) {
                // we can find a group that is not in the hashtable, if the user
                // entered %1-%1, for ex.
                // We work only with multiple ignore masks, not other..
                Integer pos = (Integer) directoryHash.get(new Integer(ma
                        .start(i)
                        + length));
                if (pos != null) {
                    fields[pos.intValue()][1] = ma.group(i);
                    System.out.println("Match " + i + ": " + ma.group(i));
                    length = length - ma.group(i).length()
                            + fields[pos.intValue()][0].length();
                } else {
                    // It was an ignore mask ok, or a double mask then we will
                    // fail
                    length = length - ma.group(i).length()
                            + fields[7][0].length();
                }
            }
        } else
            throw new OperationException(LangageManager
                    .getProperty("opex.dpattern"));
        // Directory matching finished
        // ---------------------------------------------------------------------

        // !!! Here we have to respect to order we defined in our field to know
        // Wich fields correspond to wich index i
        /*
         * We defined it like that String[][] fields = { { ARTIST_MASK , ""}, {
         * ALBUM_MASK , ""}, { TITLE_MASK , ""}, { TRACK_MASK , ""}, {
         * GENRE_MASK , ""}, { YEAR_MASK , ""}, { COMMENT_MASK , ""} };
         */

        Tag tag = f.getTag();
        for (int i = 0; i < fields.length; i++) {
            String s = fields[i][1].trim();
            if (!s.equals("")) {
                s = transformSet.transform(s);
                switch (i) {
                case 0:
                    tag.setArtist(s);
                    break;
                case 1:
                    tag.setAlbum(s);
                    break;
                case 2:
                    tag.setTitle(s);
                    break;
                case 3:
                    tag.setTrack(s);
                    break;
                case 4:
                    tag.setGenre(s);
                    break;
                case 5:
                    tag.setYear(s);
                    break;
                case 6:
                    tag.setComment(s);
                    break;
                case 7:
                    break; // Ignore
                }
            }
        }

        transformSet.transformFirstCommons(tag);

        if(tag instanceof Id3v2Tag)
            tag.setEncoding(PreferencesManager.get("entagged.tag.encoding"));
       
        try {
            AudioFileIO.write(f);
        } catch (CannotWriteException e) {
            throw new OperationException(e.getMessage());
        }
    }
View Full Code Here

Examples of net.spy.memcached.ops.OperationException

  protected void handleError(OperationErrorType eType, String line)
    throws IOException {
    getLogger().error("Error:  %s", line);
    switch(eType) {
      case GENERAL:
        exception=new OperationException();
        break;
      case SERVER:
        exception=new OperationException(eType, line);
        break;
      case CLIENT:
        exception=new OperationException(eType, line);
        break;
      default: assert false;
    }
    transitionState(OperationState.COMPLETE);
    throw exception;
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.