Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-22 03:09:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-22 03:09:59 +0300
commitd61d19da54b0fb8fd54df4007fa95cd39db17e57 (patch)
tree9c1489d1fc013b1bfa96cfc8031abece1f1c4fac /app/assets/javascripts/repository
parentfaaef22ae32e27117e83dc37334948d3b9b32501 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/repository')
-rw-r--r--app/assets/javascripts/repository/components/tree_content.vue17
-rw-r--r--app/assets/javascripts/repository/constants.js6
2 files changed, 20 insertions, 3 deletions
diff --git a/app/assets/javascripts/repository/components/tree_content.vue b/app/assets/javascripts/repository/components/tree_content.vue
index 4a8f83458f4..f6d6004ba96 100644
--- a/app/assets/javascripts/repository/components/tree_content.vue
+++ b/app/assets/javascripts/repository/components/tree_content.vue
@@ -2,12 +2,13 @@
import paginatedTreeQuery from 'shared_queries/repository/paginated_tree.query.graphql';
import { createAlert } from '~/flash';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
-import { __ } from '~/locale';
import {
TREE_PAGE_SIZE,
TREE_INITIAL_FETCH_COUNT,
TREE_PAGE_LIMIT,
COMMIT_BATCH_SIZE,
+ GITALY_UNAVAILABLE_CODE,
+ i18n,
} from '../constants';
import getRefMixin from '../mixins/get_ref';
import projectPathQuery from '../queries/project_path.query.graphql';
@@ -17,6 +18,7 @@ import FilePreview from './preview/index.vue';
import FileTable from './table/index.vue';
export default {
+ i18n,
components: {
FileTable,
FilePreview,
@@ -142,10 +144,19 @@ export default {
}
})
.catch((error) => {
+ let gitalyUnavailableError;
+ if (error.graphQLErrors) {
+ gitalyUnavailableError = error.graphQLErrors.find(
+ (e) => e?.extensions?.code === GITALY_UNAVAILABLE_CODE,
+ );
+ }
+ const message = gitalyUnavailableError
+ ? this.$options.i18n.gitalyError
+ : this.$options.i18n.generalError;
createAlert({
- message: __('An error occurred while fetching folder content.'),
+ message,
+ captureError: true,
});
- throw error;
});
},
normalizeData(key, data) {
diff --git a/app/assets/javascripts/repository/constants.js b/app/assets/javascripts/repository/constants.js
index e194bddcc56..5098053c4f7 100644
--- a/app/assets/javascripts/repository/constants.js
+++ b/app/assets/javascripts/repository/constants.js
@@ -1,5 +1,6 @@
import { __ } from '~/locale';
+export const GITALY_UNAVAILABLE_CODE = 'unavailable';
export const TREE_PAGE_LIMIT = 1000; // the maximum amount of items per page
export const TREE_PAGE_SIZE = 100; // the amount of items to be fetched per (batch) request
export const TREE_INITIAL_FETCH_COUNT = TREE_PAGE_LIMIT / TREE_PAGE_SIZE; // the amount of (batch) requests to make
@@ -100,3 +101,8 @@ export const LEGACY_FILE_TYPES = [
'cargo_toml',
'go_mod',
];
+
+export const i18n = {
+ generalError: __('An error occurred while fetching folder content.'),
+ gitalyError: __('Error: Gitaly is unavailable. Contact your administrator.'),
+};