Skip to content

Commit 44b0629

Browse files
committed
Replace missing service::schema_exception with std::logic_error
1 parent 4114b38 commit 44b0629

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

samples/client/MutateClient.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <algorithm>
99
#include <array>
10+
#include <stdexcept>
1011
#include <sstream>
1112
#include <string_view>
1213

@@ -90,14 +91,14 @@ TaskState parseTaskState(const response::Value& value)
9091
{
9192
if (!value.maybe_enum())
9293
{
93-
throw service::schema_exception { { "not a valid TaskState value" } };
94+
throw std::logic_error { "not a valid TaskState value" };
9495
}
9596

9697
const auto itr = std::find(s_namesTaskState.cbegin(), s_namesTaskState.cend(), value.get<response::StringType>());
9798

9899
if (itr == s_namesTaskState.cend())
99100
{
100-
throw service::schema_exception { { "not a valid TaskState value" } };
101+
throw std::logic_error { "not a valid TaskState value" };
101102
}
102103

103104
return static_cast<TaskState>(itr - s_namesTaskState.cbegin());

samples/client/QueryClient.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <algorithm>
99
#include <array>
10+
#include <stdexcept>
1011
#include <sstream>
1112
#include <string_view>
1213

@@ -86,14 +87,14 @@ TaskState parseTaskState(const response::Value& value)
8687
{
8788
if (!value.maybe_enum())
8889
{
89-
throw service::schema_exception { { "not a valid TaskState value" } };
90+
throw std::logic_error { "not a valid TaskState value" };
9091
}
9192

9293
const auto itr = std::find(s_namesTaskState.cbegin(), s_namesTaskState.cend(), value.get<response::StringType>());
9394

9495
if (itr == s_namesTaskState.cend())
9596
{
96-
throw service::schema_exception { { "not a valid TaskState value" } };
97+
throw std::logic_error { "not a valid TaskState value" };
9798
}
9899

99100
return static_cast<TaskState>(itr - s_namesTaskState.cbegin());

samples/client/SubscribeClient.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <algorithm>
99
#include <array>
10+
#include <stdexcept>
1011
#include <sstream>
1112
#include <string_view>
1213

src/ClientGenerator.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ bool Generator::outputSource() const noexcept
460460
461461
#include <algorithm>
462462
#include <array>
463+
#include <stdexcept>
463464
#include <sstream>
464465
#include <string_view>
465466
@@ -588,8 +589,8 @@ response::Value serialize)cpp"
588589
{
589590
if (!value.maybe_enum())
590591
{
591-
throw service::schema_exception { { "not a valid )cpp"
592-
<< cppType << R"cpp( value" } };
592+
throw std::logic_error { "not a valid )cpp"
593+
<< cppType << R"cpp( value" };
593594
}
594595
595596
const auto itr = std::find(s_names)cpp"
@@ -599,8 +600,8 @@ response::Value serialize)cpp"
599600
if (itr == s_names)cpp"
600601
<< cppType << R"cpp(.cend())
601602
{
602-
throw service::schema_exception { { "not a valid )cpp"
603-
<< cppType << R"cpp( value" } };
603+
throw std::logic_error { "not a valid )cpp"
604+
<< cppType << R"cpp( value" };
604605
}
605606
606607
return static_cast<)cpp"

0 commit comments

Comments
 (0)