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
2cb432c3
Commit
2cb432c3
authored
Mar 15, 2021
by
Rajendra Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add descriptive error message
parent
21b6f315
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
lib/gitlab/usage/metric_definition.rb
lib/gitlab/usage/metric_definition.rb
+9
-1
No files found.
lib/gitlab/usage/metric_definition.rb
View file @
2cb432c3
...
@@ -29,7 +29,15 @@ module Gitlab
...
@@ -29,7 +29,15 @@ module Gitlab
def
validate!
def
validate!
unless
skip_validation?
unless
skip_validation?
self
.
class
.
schemer
.
validate
(
attributes
.
stringify_keys
).
each
do
|
error
|
self
.
class
.
schemer
.
validate
(
attributes
.
stringify_keys
).
each
do
|
error
|
Gitlab
::
ErrorTracking
.
track_and_raise_for_dev_exception
(
Metric
::
InvalidMetricError
.
new
(
"
#{
error
[
"details"
]
||
error
[
'data_pointer'
]
||
error
[
'data'
]
}
for `
#{
path
}
`"
))
error_message
=
<<~
ERROR_MSG
Error type:
#{
error
[
'type'
]
||
nil
}
Data:
#{
error
[
'data'
]
||
nil
}
Path:
#{
error
[
'data_pointer'
]
||
nil
}
Details:
#{
error
[
'details'
]
||
nil
}
Metric file:
#{
path
}
ERROR_MSG
Gitlab
::
ErrorTracking
.
track_and_raise_for_dev_exception
(
Metric
::
InvalidMetricError
.
new
(
error_message
))
end
end
end
end
end
end
...
...
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