Skip to content

Commit

Permalink
Merge branch 'main' into ADM-837-final
Browse files Browse the repository at this point in the history
  • Loading branch information
sqsq5566 authored Mar 12, 2024
2 parents 2fd7fc4 + 5466b52 commit 3858921
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,14 @@ public class BuildKiteFeignClientDecoder implements ErrorDecoder {

@Override
public Exception decode(String methodKey, Response response) {
String errorMessage = "";
switch (methodKey) {
case "getTokenInfo":
errorMessage = "Failed to get token info";
break;
case "getBuildKiteOrganizationsInfo":
errorMessage = "Failed to get BuildKite OrganizationsInfo info";
break;
case "getPipelineInfo":
errorMessage = "Failed to get pipeline info";
break;
case "getPipelineSteps":
errorMessage = "Failed to get pipeline steps";
break;
case "getPipelineStepsInfo":
errorMessage = "Failed to get pipeline steps info";
break;
default:
break;
}
String errorMessage = switch (methodKey) {
case "getTokenInfo" -> "Failed to get token info";
case "getBuildKiteOrganizationsInfo" -> "Failed to get BuildKite OrganizationsInfo info";
case "getPipelineInfo" -> "Failed to get pipeline info";
case "getPipelineSteps" -> "Failed to get pipeline steps";
case "getPipelineStepsInfo" -> "Failed to get pipeline steps info";
default -> "Failed to get buildkite info";
};

log.error("Failed to get BuildKite info_response status: {}, method key: {}", response.status(), methodKey);
HttpStatus statusCode = HttpStatus.valueOf(response.status());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,14 @@ public class GitHubFeignClientDecoder implements ErrorDecoder {

@Override
public Exception decode(String methodKey, Response response) {
String errorMessage = "";
switch (methodKey) {
case "verifyToken":
errorMessage = "Failed to verify token";
break;
case "verifyCanReadTargetBranch":
errorMessage = "Failed to verify canRead target branch";
break;
case "getCommitInfo":
errorMessage = "Failed to get commit info";
break;
case "getPullRequestCommitInfo":
errorMessage = "Failed to get pull request commit info";
break;
case "getPullRequestListInfo":
errorMessage = "Failed to get pull request list info";
break;
default:
break;
}
String errorMessage = switch (methodKey) {
case "verifyToken" -> "Failed to verify token";
case "verifyCanReadTargetBranch" -> "Failed to verify canRead target branch";
case "getCommitInfo" -> "Failed to get commit info";
case "getPullRequestCommitInfo" -> "Failed to get pull request commit info";
case "getPullRequestListInfo" -> "Failed to get pull request list info";
default -> "Failed to get github info";
};

log.error("Failed to get GitHub info_response status: {}, method key: {}", response.status(), methodKey);
HttpStatus statusCode = HttpStatus.valueOf(response.status());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,16 @@ public class JiraFeignClientDecoder implements ErrorDecoder {

@Override
public Exception decode(String methodKey, Response response) {
String errorMessage = "";
switch (methodKey) {
case "getJiraBoardConfiguration":
errorMessage = "Failed to get jira board configuration";
break;
case "getColumnStatusCategory":
errorMessage = "Failed to get column status category";
break;
case "getJiraCards":
errorMessage = "Failed to get jira cards";
break;
case "getJiraCardHistoryByCount":
errorMessage = "Failed to get jira card history by count";
break;
case "getTargetField":
errorMessage = "Failed to get target field";
break;
case "getBoard":
errorMessage = "Failed to get board";
break;
case "getProject":
errorMessage = "Failed to get project";
break;
default:
break;
}
String errorMessage = switch (methodKey) {
case "getJiraBoardConfiguration" -> "Failed to get jira board configuration";
case "getColumnStatusCategory" -> "Failed to get column status category";
case "getJiraCards" -> "Failed to get jira cards";
case "getJiraCardHistoryByCount" -> "Failed to get jira card history by count";
case "getTargetField" -> "Failed to get target field";
case "getBoard" -> "Failed to get board";
case "getProject" -> "Failed to get project";
default -> "Failed to get jira info";
};

log.error("Failed to get Jira info_response status: {}, method key: {}", response.status(), methodKey);
HttpStatus statusCode = HttpStatus.valueOf(response.status());
Expand Down

0 comments on commit 3858921

Please sign in to comment.