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
52f5de3b
Commit
52f5de3b
authored
Oct 05, 2021
by
Jose Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sentry error handling to the job actions component
parent
1ded4b19
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
app/assets/javascripts/jobs/components/table/cells/actions_cell.vue
.../javascripts/jobs/components/table/cells/actions_cell.vue
+8
-4
app/assets/javascripts/jobs/utils.js
app/assets/javascripts/jobs/utils.js
+9
-0
No files found.
app/assets/javascripts/jobs/components/table/cells/actions_cell.vue
View file @
52f5de3b
...
@@ -18,6 +18,7 @@ import cancelJobMutation from '../graphql/mutations/job_cancel.mutation.graphql'
...
@@ -18,6 +18,7 @@ import cancelJobMutation from '../graphql/mutations/job_cancel.mutation.graphql'
import
playJobMutation
from
'
../graphql/mutations/job_play.mutation.graphql
'
;
import
playJobMutation
from
'
../graphql/mutations/job_play.mutation.graphql
'
;
import
retryJobMutation
from
'
../graphql/mutations/job_retry.mutation.graphql
'
;
import
retryJobMutation
from
'
../graphql/mutations/job_retry.mutation.graphql
'
;
import
unscheduleJobMutation
from
'
../graphql/mutations/job_unschedule.mutation.graphql
'
;
import
unscheduleJobMutation
from
'
../graphql/mutations/job_unschedule.mutation.graphql
'
;
import
{
reportMessageToSentry
}
from
'
../../../utils
'
;
export
default
{
export
default
{
ACTIONS_DOWNLOAD_ARTIFACTS
,
ACTIONS_DOWNLOAD_ARTIFACTS
,
...
@@ -34,6 +35,7 @@ export default {
...
@@ -34,6 +35,7 @@ export default {
jobPlay
:
'
jobPlay
'
,
jobPlay
:
'
jobPlay
'
,
jobUnschedule
:
'
jobUnschedule
'
,
jobUnschedule
:
'
jobUnschedule
'
,
playJobModalId
:
'
play-job-modal
'
,
playJobModalId
:
'
play-job-modal
'
,
name
:
'
JobActionsCell
'
,
components
:
{
components
:
{
GlButton
,
GlButton
,
GlButtonGroup
,
GlButtonGroup
,
...
@@ -99,15 +101,17 @@ export default {
...
@@ -99,15 +101,17 @@ export default {
variables
:
{
id
:
this
.
job
.
id
},
variables
:
{
id
:
this
.
job
.
id
},
});
});
if
(
errors
.
length
>
0
)
{
if
(
errors
.
length
>
0
)
{
this
.
reportFailure
();
reportMessageToSentry
(
this
.
$options
.
name
,
errors
.
join
(
'
,
'
),
{});
this
.
showToastMessage
();
}
else
{
}
else
{
eventHub
.
$emit
(
'
jobActionPerformed
'
);
eventHub
.
$emit
(
'
jobActionPerformed
'
);
}
}
}
catch
{
}
catch
(
failure
)
{
this
.
reportFailure
();
reportMessageToSentry
(
this
.
$options
.
name
,
failure
,
{});
this
.
showToastMessage
();
}
}
},
},
reportFailur
e
()
{
showToastMessag
e
()
{
const
toastProps
=
{
const
toastProps
=
{
text
:
this
.
$options
.
GENERIC_ERROR
,
text
:
this
.
$options
.
GENERIC_ERROR
,
variant
:
'
danger
'
,
variant
:
'
danger
'
,
...
...
app/assets/javascripts/jobs/utils.js
View file @
52f5de3b
...
@@ -19,3 +19,12 @@ export const reportToSentry = (component, failureType) => {
...
@@ -19,3 +19,12 @@ export const reportToSentry = (component, failureType) => {
Sentry
.
captureException
(
failureType
);
Sentry
.
captureException
(
failureType
);
});
});
};
};
export
const
reportMessageToSentry
=
(
component
,
message
,
context
)
=>
{
Sentry
.
withScope
((
scope
)
=>
{
// eslint-disable-next-line @gitlab/require-i18n-strings
scope
.
setContext
(
'
Vue data
'
,
context
);
scope
.
setTag
(
'
component
'
,
component
);
Sentry
.
captureMessage
(
message
);
});
};
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