Exception: Datadog::AIGuard::AIGuardAbortError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/datadog/ai_guard.rb

Overview

This error is raised when allow_raise is set to true (the default) in Evaluation.perform and AI Guard considers the messages not safe. Intended to be rescued by the user.

WARNING: This name must not change, since front-end is using it.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action:, reason:, tags:) ⇒ AIGuardAbortError

Returns a new instance of AIGuardAbortError.



22
23
24
25
26
27
28
# File 'lib/datadog/ai_guard.rb', line 22

def initialize(action:, reason:, tags:)
  super()

  @action = action
  @reason = reason
  @tags = tags
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



20
21
22
# File 'lib/datadog/ai_guard.rb', line 20

def action
  @action
end

#reasonObject (readonly)

Returns the value of attribute reason.



20
21
22
# File 'lib/datadog/ai_guard.rb', line 20

def reason
  @reason
end

#tagsObject (readonly)

Returns the value of attribute tags.



20
21
22
# File 'lib/datadog/ai_guard.rb', line 20

def tags
  @tags
end

Instance Method Details

#to_sObject



30
31
32
# File 'lib/datadog/ai_guard.rb', line 30

def to_s
  "Request interrupted. #{@reason}"
end