Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7fa42b2c
Commit
7fa42b2c
authored
Mar 05, 2021
by
Sarah GP
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust util for all err types
parent
27a3c00c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
11 deletions
+26
-11
app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue
...ts/pipelines/components/graph/graph_component_wrapper.vue
+3
-3
app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue
...ts/pipelines/components/graph/linked_pipelines_column.vue
+4
-4
app/assets/javascripts/pipelines/components/graph/utils.js
app/assets/javascripts/pipelines/components/graph/utils.js
+19
-4
No files found.
app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue
View file @
7fa42b2c
...
...
@@ -7,7 +7,7 @@ import PipelineGraph from './graph_component.vue';
import
{
getQueryHeaders
,
reportToSentry
,
serialize
GqlErr
,
serialize
LoadErrors
,
toggleQueryPollingByVisibility
,
unwrapPipelineData
,
}
from
'
./utils
'
;
...
...
@@ -61,8 +61,8 @@ export default {
update
(
data
)
{
return
unwrapPipelineData
(
this
.
pipelineProjectPath
,
data
);
},
error
(
{
gqlError
}
)
{
this
.
reportFailure
(
LOAD_FAILURE
,
serialize
GqlErr
(
gqlErro
r
));
error
(
err
)
{
this
.
reportFailure
(
LOAD_FAILURE
,
serialize
LoadErrors
(
er
r
));
},
},
},
...
...
app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue
View file @
7fa42b2c
...
...
@@ -6,7 +6,7 @@ import LinkedPipeline from './linked_pipeline.vue';
import
{
getQueryHeaders
,
reportToSentry
,
serialize
GqlErr
,
serialize
LoadErrors
,
toggleQueryPollingByVisibility
,
unwrapPipelineData
,
validateConfigPaths
,
...
...
@@ -100,13 +100,13 @@ export default {
this
.
loadingPipelineId
=
null
;
this
.
$emit
(
'
scrollContainer
'
);
},
error
(
{
gqlError
}
,
_vm
,
_key
,
type
)
{
error
(
err
,
_vm
,
_key
,
type
)
{
this
.
$emit
(
'
error
'
,
LOAD_FAILURE
);
reportToSentry
(
'
linked_pipelines_column
'
,
`error type:
${
LOAD_FAILURE
}
, error:
${
serialize
GqlErr
(
gqlErro
r
,
`error type:
${
LOAD_FAILURE
}
, error:
${
serialize
LoadErrors
(
er
r
,
)}
, apollo error type:
${
type
}
`
,
);
},
...
...
app/assets/javascripts/pipelines/components/graph/utils.js
View file @
7fa42b2c
...
...
@@ -32,10 +32,6 @@ const reportToSentry = (component, failureType) => {
};
const
serializeGqlErr
=
(
gqlError
)
=>
{
if
(
!
gqlError
)
{
return
'
gqlError data not available.
'
;
}
const
{
locations
,
message
,
path
}
=
gqlError
;
return
`
...
...
@@ -48,6 +44,24 @@ const serializeGqlErr = (gqlError) => {
`
;
};
const
serializeLoadErrors
=
(
errors
)
=>
{
const
{
gqlError
,
graphQLErrors
,
networkError
,
message
}
=
errors
;
if
(
graphQLErrors
)
{
return
graphQLErrors
.
map
((
err
)
=>
serializeGqlErr
(
err
)).
join
(
'
;
'
);
}
if
(
gqlError
)
{
return
serializeGqlErr
(
gqlError
);
}
if
(
networkError
)
{
return
`Network error:
${
networkError
.
message
}
`
;
}
return
message
;
};
/* eslint-enable @gitlab/require-i18n-strings */
const
toggleQueryPollingByVisibility
=
(
queryRef
,
interval
=
10000
)
=>
{
...
...
@@ -101,6 +115,7 @@ export {
getQueryHeaders
,
reportToSentry
,
serializeGqlErr
,
serializeLoadErrors
,
toggleQueryPollingByVisibility
,
unwrapPipelineData
,
validateConfigPaths
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment