YARN-8140. Improve log message when launch cmd is ran for stopped yarn service. Contributed by Eric Yang
(cherry picked from commit ed4e0676c357d5d18c15998b1f6b5d305848cb04)
This commit is contained in:
parent
921a3e1678
commit
91b24278da
|
@ -167,8 +167,13 @@ public class ApiServer {
|
|||
String message = "Failed to create service " + service.getName()
|
||||
+ ": {}";
|
||||
LOG.error(message, e);
|
||||
if (e.getCause().getMessage().contains("already exists")) {
|
||||
message = "Service name " + service.getName() + " is already taken.";
|
||||
} else {
|
||||
message = e.getCause().getMessage();
|
||||
}
|
||||
return formatResponse(Status.INTERNAL_SERVER_ERROR,
|
||||
e.getCause().getMessage());
|
||||
message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue