Exception: Datadog::Statsd::Schema::SchemaError Abstract
- Inherits:
-
StandardError
- Object
- StandardError
- Datadog::Statsd::Schema::SchemaError
- Defined in:
- lib/datadog/statsd/schema/errors.rb
Overview
This class is abstract.
Base class for schema validation errors
Base error class for all schema validation errors Provides context about where the error occurred including namespace, metric, and tag information
Direct Known Subclasses
DuplicateMetricError, InvalidMetricTypeError, InvalidNamespaceError, InvalidTagError, MissingRequiredTagError, UnknownMetricError
Instance Attribute Summary collapse
-
#metric ⇒ String
readonly
The metric name where the error occurred.
-
#namespace ⇒ String
readonly
The namespace where the error occurred.
-
#tag ⇒ String
readonly
The tag name where the error occurred.
Instance Method Summary collapse
-
#initialize(message = nil, namespace: "<-no-namespace->", metric: "<-no-metric->", tag: "<-no-tag->") ⇒ SchemaError
constructor
Initialize a new schema error with context information.
Constructor Details
#initialize(message = nil, namespace: "<-no-namespace->", metric: "<-no-metric->", tag: "<-no-tag->") ⇒ SchemaError
Initialize a new schema error with context information
35 36 37 38 39 40 41 42 |
# File 'lib/datadog/statsd/schema/errors.rb', line 35 def initialize( = nil, namespace: "<-no-namespace->", metric: "<-no-metric->", tag: "<-no-tag->") @namespace = namespace @metric = metric @tag = tag ||= "#{self.class.name.underscore.gsub("_", " ").split(".").map(&:capitalize).join(" ")} Error " \ "{ namespace: #{namespace}, metric: #{metric}, tag: #{tag} }" super() end |
Instance Attribute Details
#metric ⇒ String (readonly)
The metric name where the error occurred
24 25 26 |
# File 'lib/datadog/statsd/schema/errors.rb', line 24 def metric @metric end |
#namespace ⇒ String (readonly)
The namespace where the error occurred
20 21 22 |
# File 'lib/datadog/statsd/schema/errors.rb', line 20 def namespace @namespace end |
#tag ⇒ String (readonly)
The tag name where the error occurred
28 29 30 |
# File 'lib/datadog/statsd/schema/errors.rb', line 28 def tag @tag end |