Skip to content

Commit

Permalink
Lets match against the error containing the missing repository instea…
Browse files Browse the repository at this point in the history
…d of the full message
  • Loading branch information
sabarasaba committed Dec 15, 2021
1 parent ea367ae commit 8155336
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import {
EuiCallOut,
} from '@elastic/eui';

import { CLOUD_SNAPSHOT_REPOSITORY } from '../../../../../common/constants';
import { useAppContext } from '../../../app_context';
import { ResponseError } from '../../../../../common/types';
import { CLOUD_SNAPSHOT_REPOSITORY } from '../../../../../common/constants';
import { uiMetricService, UIM_BACKUP_DATA_CLOUD_CLICK } from '../../../lib/ui_metric';

interface Props {
Expand All @@ -33,7 +33,7 @@ interface Props {
}

const isMissingFoundSnapshotsRepo = (error: ResponseError) => {
return error.statusCode === 404 && error.message === `[${CLOUD_SNAPSHOT_REPOSITORY}] missing`;
return error.statusCode === 404 && error.message.toString().includes(CLOUD_SNAPSHOT_REPOSITORY);
};

export const CloudBackup: React.FunctionComponent<Props> = ({
Expand Down

0 comments on commit 8155336

Please sign in to comment.