From c3c35f59e42c10cb00494547c61ac0c09121f189 Mon Sep 17 00:00:00 2001 From: upagge Date: Wed, 8 Apr 2020 19:20:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bitbucketbot/scheduler/SchedulerPushMessageSend.java | 7 +++++-- src/main/java/com/tsc/bitbucketbot/utils/Message.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPushMessageSend.java b/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPushMessageSend.java index ccde063..8ab827f 100644 --- a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPushMessageSend.java +++ b/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPushMessageSend.java @@ -13,6 +13,7 @@ import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; +import okhttp3.Response; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; @@ -77,8 +78,10 @@ public class SchedulerPushMessageSend { .post(body) .build(); - try { - client.newCall(request).execute(); + try (final Response response = client.newCall(request).execute()) { + if (response.code() != 200) { + log.error("Ошибка отправки сообщения: " + response); + } } catch (IOException e) { log.error(e.getMessage()); } diff --git a/src/main/java/com/tsc/bitbucketbot/utils/Message.java b/src/main/java/com/tsc/bitbucketbot/utils/Message.java index 7cc11cd..3894b8d 100644 --- a/src/main/java/com/tsc/bitbucketbot/utils/Message.java +++ b/src/main/java/com/tsc/bitbucketbot/utils/Message.java @@ -102,7 +102,7 @@ public class Message { } public static String generate(@NonNull ConflictPrChange change) { - return Smile.DANGEROUS + "*Внимание конфлик в ПР*" + Smile.HR + + return Smile.DANGEROUS + "*Внимание конфликт в ПР*" + Smile.HR + link(change.getName(), change.getUrl()) + Smile.TWO_BR; }