提交 8a638486 编写于 作者: G Gian Merlino

Better task log errors.

上级 8c73ef64
......@@ -398,7 +398,12 @@ public class OverlordResource
if (stream.isPresent()) {
return Response.ok(stream.get().getInput()).build();
} else {
return Response.status(Response.Status.NOT_FOUND).build();
return Response.status(Response.Status.NOT_FOUND)
.entity(
"No log was found for this task. "
+ "The task may not exist, or it may not have begun running yet."
)
.build();
}
}
catch (Exception e) {
......
......@@ -97,8 +97,9 @@ public class S3TaskLogs implements TaskLogs
);
}
catch (ServiceException e) {
if (e.getErrorCode() != null && (e.getErrorCode().equals("NoSuchKey") || e.getErrorCode()
.equals("NoSuchBucket"))) {
if (404 == e.getResponseCode()
|| "NoSuchKey".equals(e.getErrorCode())
|| "NoSuchBucket".equals(e.getErrorCode())) {
return Optional.absent();
} else {
throw new IOException(String.format("Failed to stream logs from: %s", taskKey), e);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册