mirror of https://github.com/apache/druid.git
Merge pull request #575 from metamx/task-log-errors
Better task log errors.
This commit is contained in:
commit
497a5ab70c
|
@ -398,7 +398,12 @@ public class OverlordResource
|
||||||
if (stream.isPresent()) {
|
if (stream.isPresent()) {
|
||||||
return Response.ok(stream.get().getInput()).build();
|
return Response.ok(stream.get().getInput()).build();
|
||||||
} else {
|
} 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) {
|
catch (Exception e) {
|
||||||
|
|
|
@ -97,8 +97,9 @@ public class S3TaskLogs implements TaskLogs
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch (ServiceException e) {
|
catch (ServiceException e) {
|
||||||
if (e.getErrorCode() != null && (e.getErrorCode().equals("NoSuchKey") || e.getErrorCode()
|
if (404 == e.getResponseCode()
|
||||||
.equals("NoSuchBucket"))) {
|
|| "NoSuchKey".equals(e.getErrorCode())
|
||||||
|
|| "NoSuchBucket".equals(e.getErrorCode())) {
|
||||||
return Optional.absent();
|
return Optional.absent();
|
||||||
} else {
|
} else {
|
||||||
throw new IOException(String.format("Failed to stream logs from: %s", taskKey), e);
|
throw new IOException(String.format("Failed to stream logs from: %s", taskKey), e);
|
||||||
|
|
Loading…
Reference in New Issue