Skip to content

Commit

Permalink
Rephrase warnings if API is unavailable (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
drpatelh authored May 17, 2023
1 parent 3582751 commit c17fb18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/main/java/io/seqera/tower/cli/commands/runs/DumpCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private void dumpWorkflowDetails(PrintWriter progress, TarArchiveOutputStream ou
File nextflowLog = api().downloadWorkflowLog(workflow.getId(), String.format("nf-%s.log", workflow.getId()), wspId);
addFile(out, "nextflow.log", nextflowLog);
} catch (ApiException e) {
// Ignore error 404 that means that the file it is no longer available
// Ignore error 404 that means that the file is no longer available
if (e.getCode() != 404) {
throw e;
}
Expand Down Expand Up @@ -210,7 +210,7 @@ private void addTaskLogs(PrintWriter progress, TarArchiveOutputStream out, Long
File taskOut = api().downloadWorkflowTaskLog(workflowId, task.getTaskId(), ".command.out", wspId);
addFile(out, String.format("tasks/%d/.command.out", task.getTaskId()), taskOut);
} catch (ApiException e) {
// Ignore error 404 that means that the file it is no longer available
// Ignore error 404 that means that the file is no longer available
if (e.getCode() != 404) {
throw e;
}
Expand All @@ -220,7 +220,7 @@ private void addTaskLogs(PrintWriter progress, TarArchiveOutputStream out, Long
File taskOut = api().downloadWorkflowTaskLog(workflowId, task.getTaskId(), ".command.err", wspId);
addFile(out, String.format("tasks/%d/.command.err", task.getTaskId()), taskOut);
} catch (ApiException e) {
// Ignore error 404 that means that the file it is no longer available
// Ignore error 404 that means that the file is no longer available
if (e.getCode() != 404) {
throw e;
}
Expand All @@ -230,7 +230,7 @@ private void addTaskLogs(PrintWriter progress, TarArchiveOutputStream out, Long
File taskOut = api().downloadWorkflowTaskLog(workflowId, task.getTaskId(), ".command.log", wspId);
addFile(out, String.format("tasks/%d/.command.log", task.getTaskId()), taskOut);
} catch (ApiException e) {
// Ignore error 404 that means that the file it is no longer available
// Ignore error 404 that means that the file is no longer available
if (e.getCode() != 404) {
throw e;
}
Expand All @@ -242,7 +242,7 @@ private void addTaskLogs(PrintWriter progress, TarArchiveOutputStream out, Long
File taskOut = api().downloadWorkflowTaskLog(workflowId, task.getTaskId(), ".fusion.log", wspId);
addFile(out, String.format("tasks/%d/.fusion.log", task.getTaskId()), taskOut);
} catch (ApiException e) {
// Ignore error 404 that means that the file it is no longer available
// Ignore error 404 that means that the file is no longer available
if (e.getCode() != 404) {
throw e;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/seqera/tower/cli/responses/InfoResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public void toString(PrintWriter out) {

if (connectionCheck == 0) {
if (opts.get("towerApiEndpoint").contains("/api")) {
out.println(ansi(String.format("%n @|bold,fg(red) Tower API URL %s it is not available|@%n", opts.get("towerApiEndpoint"))));
out.println(ansi(String.format("%n @|bold,fg(red) Tower API URL %s is not available|@%n", opts.get("towerApiEndpoint"))));
} else {
out.println(ansi(String.format("%n @|bold,fg(red) Tower API URL %s it is not available (did you mean %s/api?)|@%n", opts.get("towerApiEndpoint"), opts.get("towerApiEndpoint"))));
out.println(ansi(String.format("%n @|bold,fg(red) Tower API URL %s is not available (did you mean %s/api?)|@%n", opts.get("towerApiEndpoint"), opts.get("towerApiEndpoint"))));
}
}

Expand Down

0 comments on commit c17fb18

Please sign in to comment.