Skip to content

Commit

Permalink
Workaround error thrown from metadata server when there is no record (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobgy authored and k8s-ci-robot committed Sep 16, 2019
1 parent 33f4244 commit 49834c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions frontend/src/pages/ArtifactList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ class ArtifactList extends Page<{}, ArtifactListState> {

private async reload(request: ListRequest): Promise<string> {
Apis.getMetadataServiceClient().getArtifacts(new GetArtifactsRequest(), (err, res) => {
if (err) {
// Code === 5 means no record found in backend. This is a temporary workaround.
// TODO: remove err.code !== 5 check when backend is fixed.
if (err && err.code !== 5) {
this.showPageError(serviceErrorToString(err));
return;
}
Expand All @@ -129,7 +131,7 @@ class ArtifactList extends Page<{}, ArtifactListState> {
{props.value}
</Link>
);
}
}

/**
* Temporary solution to apply sorting, filtering, and pagination to the
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/pages/ExecutionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ class ExecutionList extends Page<{}, ExecutionListState> {

private async reload(request: ListRequest): Promise<string> {
Apis.getMetadataServiceClient().getExecutions(new GetExecutionsRequest(), (err, res) => {
if (err) {
// Code === 5 means no record found in backend. This is a temporary workaround.
// TODO: remove err.code !== 5 check when backend is fixed.
if (err && err.code !== 5) {
this.showPageError(serviceErrorToString(err));
return;
}
Expand All @@ -126,7 +128,7 @@ class ExecutionList extends Page<{}, ExecutionListState> {
{props.value}
</Link>
);
}
}

/**
* Temporary solution to apply sorting, filtering, and pagination to the
Expand Down

0 comments on commit 49834c4

Please sign in to comment.