Skip to content

Commit 6498b07

Browse files
committed
ST6RI-836 getProjectById returns null of project doesn't exist
- when trying to query a project by id instead of throwing an exception getProjectById return null. This matches with the logic used in by getProjectByName
1 parent 6d6d9d2 commit 6498b07

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

org.omg.sysml/src/org/omg/sysml/util/repository/ProjectRepository.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ public RemoteProject getPRojectById(UUID projectId) {
185185
Project projectById = getProjectApi().getProjectById(projectId);
186186
return projectById == null? null: new RemoteProject(this, projectId, projectById.getName());
187187
} catch (ApiException e) {
188-
throw new RemoteException("Error occured while trying to query the project", e);
188+
if (e.getCode() == 404) {
189+
return null;
190+
} else {
191+
throw new RemoteException("Error occured while trying to query the project", e);
192+
}
189193
}
190194
}
191195

0 commit comments

Comments
 (0)