1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package nl.toolforge.karma.core.cmd.event;
20
21 import nl.toolforge.karma.core.cmd.Command;
22 import nl.toolforge.karma.core.cmd.CommandException;
23
24 /***
25 * Generated when the command execution failed with a <code>CommandException</code>. This event is - by default -
26 * generated when the {@link nl.toolforge.karma.core.cmd.CommandContext#execute(Command)}-method caught a
27 * CommandException.
28 *
29 * @author D.A. Smedes
30 * @version $Id: CommandFailedEvent.java,v 1.2 2004/10/26 22:47:57 hippe Exp $
31 */
32 public final class CommandFailedEvent extends ExceptionEvent {
33
34 /***
35 * Creates the event for <code>command</code>.
36 *
37 * @param command The command that has started.
38 */
39 public CommandFailedEvent(Command command, CommandException exception) {
40 super(command, exception);
41 }
42
43 /***
44 * Returns a SimpleMessage formatted as <code>[ <command-name> ] Started.</code>.
45 */
46 public Message getEventMessage() {
47 return new SimpleMessage(MessageHelper.format(getCommand().getName(), "Command FAILED!"));
48 }
49 }