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
acd018f9
Commit
acd018f9
authored
Oct 30, 2020
by
Miguel Rincon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify error message handling in component
parent
88d164a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
...ssets/javascripts/pipeline_editor/pipeline_editor_app.vue
+7
-10
No files found.
app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
View file @
acd018f9
...
...
@@ -56,22 +56,19 @@ export default {
return
this
.
$apollo
.
queries
.
content
.
loading
;
},
errorMessage
()
{
const
{
message
,
networkError
}
=
this
.
error
??
{};
const
{
message
:
generalReason
,
networkError
}
=
this
.
error
??
{};
let
reason
=
message
??
this
.
$options
.
i18n
.
unknownMessage
;
if
(
networkError
&&
networkError
.
response
)
{
const
{
data
=
{}
}
=
networkError
.
response
;
// 400 for a missing ref uses `error`
// 404 for missing file uses `message`
reason
=
data
.
message
??
data
.
error
??
reason
;
}
const
{
data
}
=
networkError
?.
response
??
{};
// 404 for missing file uses `message`
// 400 for a missing ref uses `error`
const
networkReason
=
data
?.
message
??
data
?.
error
;
const
reason
=
networkReason
??
generalReason
??
this
.
$options
.
i18n
.
unknownError
;
return
sprintf
(
this
.
$options
.
i18n
.
errorMessageWithReason
,
{
reason
});
},
},
i18n
:
{
unknown
Message
:
__
(
'
Unknown Error
'
),
unknown
Error
:
__
(
'
Unknown Error
'
),
errorMessageWithReason
:
s__
(
'
Pipelines|CI file could not be loaded: %{reason}
'
),
},
};
...
...
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