Skip to content
Snippets Groups Projects
Select Git revision
  • c7674844e7be35a4e66208b8de45f8f1ca17248e
  • master default protected
  • exec_auto_adjust_trace
  • let_variables
  • v1.4.1
  • v1.4.0
  • v1.3.0
  • v1.2.0
  • v1.1.0
  • v1.0.0
10 results

CommandExecutionException.java

Blame
  • user avatar
    dgelessus authored
    The commands package now only contains actual command classes. This
    makes the non-command classes easier to find.
    099a52bd
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    CommandExecutionException.java 701 B
    package de.prob2.jupyter;
    
    import org.jetbrains.annotations.NotNull;
    
    public final class CommandExecutionException extends UserErrorException {
    	private static final long serialVersionUID = 1L;
    	
    	private final @NotNull String commandName;
    	
    	public CommandExecutionException(final @NotNull String commandName, final @NotNull Throwable cause) {
    		super(formatMessage(commandName, cause.getMessage()), cause);
    		
    		this.commandName = commandName;
    	}
    	
    	private static @NotNull String formatMessage(final @NotNull String commandName, final @NotNull String message) {
    		return String.format("%s: %s", commandName, message);
    	}
    	
    	public @NotNull String getCommandName() {
    		return this.commandName;
    	}
    }