Skip to content

Commit

Permalink
fixup! CHE-6557 Make RuntimeDto to return machine token
Browse files Browse the repository at this point in the history
  • Loading branch information
sleshchenko committed Oct 13, 2017
1 parent e22deca commit 3ac5b90
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl;
import org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl;
import org.eclipse.che.api.workspace.server.model.impl.WorkspaceImpl;
import org.eclipse.che.api.workspace.server.token.MachineTokenException;
import org.eclipse.che.api.workspace.server.token.MachineTokenProvider;
import org.eclipse.che.api.workspace.shared.dto.CommandDto;
import org.eclipse.che.api.workspace.shared.dto.EnvironmentDto;
Expand Down Expand Up @@ -796,7 +797,11 @@ private WorkspaceDto asDtoWithLinksAndToken(Workspace workspace) throws ServerEx

RuntimeDto runtimeDto = workspaceDto.getRuntime();
if (runtimeDto != null) {
runtimeDto.setUserToken(machineTokenProvider.getToken(workspace.getId()));
try {
runtimeDto.setUserToken(machineTokenProvider.getToken(workspace.getId()));
} catch (MachineTokenException e) {
throw new ServerException(e.getMessage(), e);
}
}

return workspaceDto;
Expand Down

0 comments on commit 3ac5b90

Please sign in to comment.