Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
amihaiemil committed Sep 4, 2017
1 parent 259ef82 commit 4c1cdf9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
19 changes: 5 additions & 14 deletions src/main/java/com/amihaiemil/charles/github/Action.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,14 @@ public void perform() {
this.logger.warn("No command found in the issue or the agent has already replied to the last command!");
} catch (final IOException e) {
this.logger.error("Action failed entirely with exception: ", e);
this.sendReply(
new ErrorReply(logs.address(), this.issue)
);
try {
new ErrorReply(logs.address(), this.issue).send();
} catch (IOException errReplyEx) {
this.logger.error("FAILED TO SEND ERROR-REPLY!", errReplyEx);
}
}
}

/**
* Send the reply to Github issue.
* @param reply
*/
private void sendReply(Reply reply) {
try {
reply.send();
} catch (IOException e) {
this.logger.error("FAILED TO REPLY!", e);
}
}

/**
* Setup the Log4J logger for this action thread.
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/amihaiemil/charles/github/TextReply.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ public TextReply(Command com, String response) {
*/
@Override
public void send() throws IOException {
String cmdPreview = "> " + this.command.json().getString("body") + "\n\n";

command.issue().comments().post(
final String cmdPreview = "> " + this.command.json().getString("body") + "\n\n";
this.command.issue().comments().post(
cmdPreview + this.response
);
}
Expand Down

0 comments on commit 4c1cdf9

Please sign in to comment.