Exception: MedicalCopays::VBS::InvalidVBSRequestError

Inherits:
StandardError
  • Object
show all
Defined in:
app/services/medical_copays/vbs/invalid_vbs_request_error.rb

Overview

Custom error object for handling invalid VBS request params

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json_schema_errors) ⇒ InvalidVBSRequestError

Returns a new instance of InvalidVBSRequestError.



13
14
15
16
17
18
19
20
# File 'app/services/medical_copays/vbs/invalid_vbs_request_error.rb', line 13

def initialize(json_schema_errors)
  @errors = json_schema_errors
  message = json_schema_errors.pluck(:message)

  StatsD.increment('api.mcp.vbs.failure')

  super(message)
end

Instance Attribute Details

#errorsArray

Returns:

  • (Array)


10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/services/medical_copays/vbs/invalid_vbs_request_error.rb', line 10

class InvalidVBSRequestError < StandardError
  attr_accessor :errors

  def initialize(json_schema_errors)
    @errors = json_schema_errors
    message = json_schema_errors.pluck(:message)

    StatsD.increment('api.mcp.vbs.failure')

    super(message)
  end
end