Examples of CommandException


Examples of com.azaptree.services.command.CommandException

    } catch (final CommandException | ValidationException | IllegalArgumentException e) {
      metric.failed(e);
      throw e;
    } catch (final Throwable t) {
      metric.failed(t);
      throw new CommandException(t);
    } finally {
      commandMetricLog.info("{} : {}", key, metric);
    }
  }
View Full Code Here

Examples of com.cloudloop.client.cli.exceptions.CommandException

    protected void assertCorrectNumberOfArgs( CommandLineArguments args,
                                              int                  minArgs )
    {
        if ( args.size(  ) < minArgs )
        {
            throw new CommandException( "Wrong number of arguments.\n" + "Usage:" + getUsage(  ) );
        }
    }
View Full Code Here

Examples of com.google.devtools.moe.client.CommandRunner.CommandException

                "--limit=1",
                "--template={node}",
                "--rev=bogusChangeset"),
            CLONE_TEMP_DIR /*workingDirectory*/))
        .andThrow(
            new CommandException(
                "hg",
                ImmutableList.<String>of("mock args"),
                "mock stdout",
                "mock stderr: unknown revision",
                255 /* Hg error code for unknown rev */));
 
View Full Code Here

Examples of com.mcbans.firestar.mcbans.exception.CommandException

            reason = Util.join(args, " ");
        }
       
        // check isValid IP address
        if (!Util.isValidIP(target)){
            throw new CommandException(ChatColor.RED + _("invalidIP"));
        }

        // Start
        BanIpRequest request = new BanIpRequest(plugin, new MessageCallback(plugin, sender), target, reason, senderName, senderUUID);
        Thread triggerThread = new Thread(request);
View Full Code Here

Examples of com.sijobe.spc.wrapper.CommandException

                  FontColour.WHITE + " for more information.");
         sender.sendMessageToPlayer(MESSAGE_FOOTER);
      } else { //-------------------Specific Help
         String command = (String)params.get(0);
         if (!CommandManager.doesCommandExist(command) || !CommandManager.isCommandEnabled(command)) {
            throw new CommandException("Specified command name " + command +
                     " does not exist or is not enabled.");
         }
         String description = CommandManager.getCommandDescription(command);
         String example = CommandManager.getCommandExample(command);
         String usage = CommandManager.getCommandUsage(command, sender);
View Full Code Here

Examples of com.sk89q.intake.CommandException

            for (int i = 1; i < arg.length(); ++i) {
                char flagName = arg.charAt(i);

                if (valueFlags.contains(flagName)) {
                    if (this.valueFlags.containsKey(flagName)) {
                        throw new CommandException("Value flag '" + flagName + "' already given");
                    }

                    if (nextArg >= argList.size()) {
                        if (allowHangingFlag) {
                            suggestionContext = SuggestionContext.flag(flagName);
                            break;
                        } else {
                            throw new CommandException("No value specified for the '-" + flagName + "' flag.");
                        }
                    }

                    // If it is a value flag, read another argument and add it
                    this.valueFlags.put(flagName, argList.get(nextArg++));
View Full Code Here

Examples of com.sk89q.minecraft.util.commands.CommandException

    public void fromString(String str) throws CommandException {
        Type type = Type.findByPattern(str);
        if (type != null) {
            this.type = type;
        } else {
            throw new CommandException("Acceptable types: projectiles, items, paintings, itemframes, boats, minecarts, tnt, xp, or all");
        }
    }
View Full Code Here

Examples of com.sk89q.minecraft.util.commands.CommandException

        List<Countable<Integer>> distribution = null;
        List<Countable<BaseBlock>> distributionData = null;

        if (args.hasFlag('c')) {
            // TODO: Update for new clipboard
            throw new CommandException("Needs to be re-written again");
        } else {
            if (useData) {
                distributionData = editSession.getBlockDistributionWithData(session.getSelection(player.getWorld()));
            } else {
                distribution = editSession.getBlockDistribution(session.getSelection(player.getWorld()));
View Full Code Here

Examples of com.sk89q.minecraft.util.commands.CommandException

        try {
            // Create parent directories
            File parent = f.getParentFile();
            if (parent != null && !parent.exists()) {
                if (!parent.mkdirs()) {
                    throw new CommandException("Could not create folder for schematics!");
                }
            }

            FileOutputStream fos = closer.register(new FileOutputStream(f));
            BufferedOutputStream bos = closer.register(new BufferedOutputStream(fos));
View Full Code Here

Examples of com.sk89q.minecraft.util.commands.CommandException

    @ExceptionMatch
    public void convert(NumberFormatException e) throws CommandException {
        final Matcher matcher = numberFormat.matcher(e.getMessage());

        if (matcher.matches()) {
            throw new CommandException("Number expected; string \"" + matcher.group(1)
                    + "\" given.");
        } else {
            throw new CommandException("Number expected; string given.");
        }
    }
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.