lib/roqua/healthy/a19/response_validator.rb in roqua-healthy-1.5.0 vs lib/roqua/healthy/a19/response_validator.rb in roqua-healthy-1.5.1

- old
+ new

@@ -9,25 +9,10 @@ attr_reader :response_code attr_reader :parser attr_reader :patient_id - ERRORS = { - 'Timeout waiting for ACK' => - ::Roqua::Healthy::Timeout, - "Unable to connect to destination\tSocketTimeoutException\tconnect timed out" => - ::Roqua::Healthy::Timeout, - 'ERROR: Timeout waiting for response' => - ::Roqua::Healthy::Timeout, - 'ERROR: SocketTimeoutException: connect timed out' => - ::Roqua::Healthy::Timeout, - "Unable to connect to destination\tConnectException\tConnection refused" => - ::Roqua::Healthy::ConnectionRefused, - 'ERROR: ConnectException: Connection refused' => - ::Roqua::Healthy::ConnectionRefused - }.freeze - def initialize(response_code, parser, patient_id) @response_code = response_code @parser = parser @patient_id = patient_id end @@ -62,10 +47,10 @@ raise ::Roqua::Healthy::PatientNotFound end def validate_500 error = parser.fetch('failure')['error'] - raise ERRORS[error], error if ERRORS[error] + raise ::Roqua::Healthy::ERRORS[error], error if ::Roqua::Healthy::ERRORS[error] raise ::Roqua::Healthy::UnknownFailure, error end private