def throw_if_error()

in aidial_adapter_bedrock/llm/model/stability/v2.py [0:0]


    def throw_if_error(self):
        error = next((reason for reason in self.finish_reasons if reason), None)
        if not error:
            return

        if error == "Inference error":
            raise RuntimeError(error)
        else:
            raise ValidationError(error)