From f2247f03f48257651e67c243b72445149a4a1d43 Mon Sep 17 00:00:00 2001 From: Joshua Scott Date: Fri, 6 Apr 2018 04:24:10 +0100 Subject: [PATCH] protocol: Fix typo in MessageBuilder --- include/ki/protocol/dml/MessageBuilder.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/ki/protocol/dml/MessageBuilder.h b/include/ki/protocol/dml/MessageBuilder.h index 2b2e134..33995eb 100644 --- a/include/ki/protocol/dml/MessageBuilder.h +++ b/include/ki/protocol/dml/MessageBuilder.h @@ -1,6 +1,8 @@ #pragma once #include "Message.h" +#include "ki/protocol/exception.h" #include +#include namespace ki { @@ -20,10 +22,12 @@ namespace dml template MessageBuilder &set_field_value(std::string name, ValueT value) { - auto *field = m_message->get_record().get_field(name); + auto *field = m_message->get_record()->get_field(name); if (!field) { - // TODO: Exceptions + std::ostringstream oss; + oss << "No field with name " << name << " exists with specified type."; + throw value_error(oss.str()); } field->set_value(value); return *this; @@ -35,4 +39,4 @@ namespace dml }; } } -} \ No newline at end of file +}