@@ -45,14 +45,18 @@ TEST(Simple, DefaultFieldValue) {
4545TEST (Simple, IntegerMinimum) {
4646 auto json = formats::json::MakeObject (" int3" , 1 , " int" , -10 );
4747 UEXPECT_THROW_MSG (
48- json.As <ns::SimpleObject>(), chaotic::Error, " Error at path 'int': Invalid value, minimum=-1, given=-10"
48+ json.As <ns::SimpleObject>(),
49+ chaotic::Error<formats::json::Value>,
50+ " Error at path 'int': Invalid value, minimum=-1, given=-10"
4951 );
5052}
5153
5254TEST (Simple, IntegerMaximum) {
5355 auto json = formats::json::MakeObject (" int3" , 1 , " int" , 11 );
5456 UEXPECT_THROW_MSG (
55- json.As <ns::SimpleObject>(), chaotic::Error, " Error at path 'int': Invalid value, maximum=10, given=11"
57+ json.As <ns::SimpleObject>(),
58+ chaotic::Error<formats::json::Value>,
59+ " Error at path 'int': Invalid value, maximum=10, given=11"
5660 );
5761}
5862
@@ -78,7 +82,9 @@ TEST(Simple, IntegerFormat) {
7882TEST (Simple, ObjectWithRefType) {
7983 auto json = formats::json::MakeObject (" integer" , 0 );
8084 UEXPECT_THROW_MSG (
81- json.As <ns::ObjectWithRef>(), chaotic::Error, " Error at path 'integer': Invalid value, minimum=1, given=0"
85+ json.As <ns::ObjectWithRef>(),
86+ chaotic::Error<formats::json::Value>,
87+ " Error at path 'integer': Invalid value, minimum=1, given=0"
8288 );
8389}
8490
@@ -141,7 +147,9 @@ TEST(Simple, ObjectExtraMemberFalse) {
141147TEST (Simple, ObjectWithAdditionalPropertiesFalseStrict) {
142148 auto json = formats::json::MakeObject (" foo" , 1 , " bar" , 2 );
143149 UEXPECT_THROW_MSG (
144- json.As <ns::ObjectWithAdditionalPropertiesFalseStrict>(), std::runtime_error, " Unknown property 'bar'"
150+ json.As <ns::ObjectWithAdditionalPropertiesFalseStrict>(),
151+ chaotic::Error<formats::json::Value>,
152+ " Unknown property 'bar'"
145153 );
146154}
147155
@@ -156,7 +164,7 @@ TEST(Simple, IntegerEnum) {
156164 auto json2 = formats::json::MakeObject (" one" , 5 );
157165 UEXPECT_THROW_MSG (
158166 json2[" one" ].As <ns::IntegerEnum>(),
159- chaotic::Error,
167+ chaotic::Error<formats::json::Value> ,
160168 " Error at path 'one': Invalid enum value (5) for type ns::IntegerEnum"
161169 );
162170
@@ -181,7 +189,7 @@ TEST(Simple, StringEnum) {
181189 auto json2 = formats::json::MakeObject (" one" , " zoo" );
182190 UEXPECT_THROW_MSG (
183191 json2[" one" ].As <ns::StringEnum>(),
184- chaotic::Error,
192+ chaotic::Error<formats::json::Value> ,
185193 " Error at path 'one': Invalid enum value (zoo) for type ns::StringEnum"
186194 );
187195
0 commit comments