@@ -1358,10 +1358,11 @@ mod json_parsing_tests {
1358
1358
]
1359
1359
) ;
1360
1360
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1361
- expect_err( & json, & e , & ExpectedErrorMessage :: error_and_help (
1361
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error (
1362
1362
"in uid field of <unknown entity>, expected a literal entity reference, but got `null`" ,
1363
+ ) . help(
1363
1364
r#"literal entity references can be made with `{ "type": "SomeType", "id": "SomeId" }`"# ,
1364
- ) ) ;
1365
+ ) . build ( ) ) ;
1365
1366
} ) ;
1366
1367
1367
1368
let json = serde_json:: json!(
@@ -1374,10 +1375,11 @@ mod json_parsing_tests {
1374
1375
]
1375
1376
) ;
1376
1377
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1377
- expect_err( & json, & e , & ExpectedErrorMessage :: error_and_help (
1378
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error (
1378
1379
r#"in uid field of <unknown entity>, expected a literal entity reference, but got `{"id":"bar","type":null}`"# ,
1380
+ ) . help(
1379
1381
r#"literal entity references can be made with `{ "type": "SomeType", "id": "SomeId" }`"# ,
1380
- ) ) ;
1382
+ ) . build ( ) ) ;
1381
1383
} ) ;
1382
1384
1383
1385
let json = serde_json:: json!(
@@ -1390,10 +1392,11 @@ mod json_parsing_tests {
1390
1392
]
1391
1393
) ;
1392
1394
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1393
- expect_err( & json, & e , & ExpectedErrorMessage :: error_and_help (
1395
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error (
1394
1396
r#"in uid field of <unknown entity>, expected a literal entity reference, but got `{"id":null,"type":"foo"}`"# ,
1397
+ ) . help(
1395
1398
r#"literal entity references can be made with `{ "type": "SomeType", "id": "SomeId" }`"# ,
1396
- ) ) ;
1399
+ ) . build ( ) ) ;
1397
1400
} ) ;
1398
1401
1399
1402
let json = serde_json:: json!(
@@ -1406,9 +1409,9 @@ mod json_parsing_tests {
1406
1409
]
1407
1410
) ;
1408
1411
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1409
- expect_err( & json, & e , & ExpectedErrorMessage :: error(
1412
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error(
1410
1413
"invalid type: null, expected a map"
1411
- ) ) ;
1414
+ ) . build ( ) ) ;
1412
1415
} ) ;
1413
1416
1414
1417
let json = serde_json:: json!(
@@ -1421,9 +1424,9 @@ mod json_parsing_tests {
1421
1424
]
1422
1425
) ;
1423
1426
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1424
- expect_err( & json, & e , & ExpectedErrorMessage :: error(
1427
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error(
1425
1428
r#"in attribute `attr` on `foo::"bar"`, found a `null`; JSON `null`s are not allowed in Cedar"# ,
1426
- ) ) ;
1429
+ ) . build ( ) ) ;
1427
1430
} ) ;
1428
1431
1429
1432
let json = serde_json:: json!(
@@ -1436,9 +1439,9 @@ mod json_parsing_tests {
1436
1439
]
1437
1440
) ;
1438
1441
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1439
- expect_err( & json, & e , & ExpectedErrorMessage :: error(
1442
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error(
1440
1443
r#"in attribute `attr` on `foo::"bar"`, found a `null`; JSON `null`s are not allowed in Cedar"# ,
1441
- ) ) ;
1444
+ ) . build ( ) ) ;
1442
1445
} ) ;
1443
1446
1444
1447
let json = serde_json:: json!(
@@ -1451,9 +1454,9 @@ mod json_parsing_tests {
1451
1454
]
1452
1455
) ;
1453
1456
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1454
- expect_err( & json, & e , & ExpectedErrorMessage :: error(
1457
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error(
1455
1458
r#"in attribute `attr` on `foo::"bar"`, found a `null`; JSON `null`s are not allowed in Cedar"# ,
1456
- ) ) ;
1459
+ ) . build ( ) ) ;
1457
1460
} ) ;
1458
1461
1459
1462
let json = serde_json:: json!(
@@ -1466,9 +1469,9 @@ mod json_parsing_tests {
1466
1469
]
1467
1470
) ;
1468
1471
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1469
- expect_err( & json, & e , & ExpectedErrorMessage :: error(
1472
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error(
1470
1473
r#"in attribute `attr` on `foo::"bar"`, found a `null`; JSON `null`s are not allowed in Cedar"# ,
1471
- ) ) ;
1474
+ ) . build ( ) ) ;
1472
1475
} ) ;
1473
1476
1474
1477
let json = serde_json:: json!(
@@ -1481,9 +1484,9 @@ mod json_parsing_tests {
1481
1484
]
1482
1485
) ;
1483
1486
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1484
- expect_err( & json, & e , & ExpectedErrorMessage :: error(
1487
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error(
1485
1488
r#"in attribute `__extn` on `foo::"bar"`, found a `null`; JSON `null`s are not allowed in Cedar"# ,
1486
- ) ) ;
1489
+ ) . build ( ) ) ;
1487
1490
} ) ;
1488
1491
1489
1492
let json = serde_json:: json!(
@@ -1496,9 +1499,9 @@ mod json_parsing_tests {
1496
1499
]
1497
1500
) ;
1498
1501
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1499
- expect_err( & json, & e , & ExpectedErrorMessage :: error(
1502
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error(
1500
1503
r#"in attribute `__extn` on `foo::"bar"`, found a `null`; JSON `null`s are not allowed in Cedar"# ,
1501
- ) ) ;
1504
+ ) . build ( ) ) ;
1502
1505
} ) ;
1503
1506
1504
1507
let json = serde_json:: json!(
@@ -1511,9 +1514,9 @@ mod json_parsing_tests {
1511
1514
]
1512
1515
) ;
1513
1516
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1514
- expect_err( & json, & e , & ExpectedErrorMessage :: error(
1517
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error(
1515
1518
r#"in attribute `__extn` on `foo::"bar"`, found a `null`; JSON `null`s are not allowed in Cedar"# ,
1516
- ) ) ;
1519
+ ) . build ( ) ) ;
1517
1520
} ) ;
1518
1521
1519
1522
let json = serde_json:: json!(
@@ -1526,9 +1529,9 @@ mod json_parsing_tests {
1526
1529
]
1527
1530
) ;
1528
1531
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1529
- expect_err( & json, & e , & ExpectedErrorMessage :: error(
1532
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error(
1530
1533
"invalid type: null, expected a sequence"
1531
- ) ) ;
1534
+ ) . build ( ) ) ;
1532
1535
} ) ;
1533
1536
1534
1537
let json = serde_json:: json!(
@@ -1541,10 +1544,11 @@ mod json_parsing_tests {
1541
1544
]
1542
1545
) ;
1543
1546
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1544
- expect_err( & json, & e , & ExpectedErrorMessage :: error_and_help (
1547
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error (
1545
1548
r#"in parents field of `foo::"bar"`, expected a literal entity reference, but got `null`"# ,
1549
+ ) . help(
1546
1550
r#"literal entity references can be made with `{ "type": "SomeType", "id": "SomeId" }`"# ,
1547
- ) ) ;
1551
+ ) . build ( ) ) ;
1548
1552
} ) ;
1549
1553
1550
1554
let json = serde_json:: json!(
@@ -1557,10 +1561,11 @@ mod json_parsing_tests {
1557
1561
]
1558
1562
) ;
1559
1563
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1560
- expect_err( & json, & e , & ExpectedErrorMessage :: error_and_help (
1564
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error (
1561
1565
r#"in parents field of `foo::"bar"`, expected a literal entity reference, but got `{"id":null,"type":"foo"}`"# ,
1566
+ ) . help(
1562
1567
r#"literal entity references can be made with `{ "type": "SomeType", "id": "SomeId" }`"# ,
1563
- ) ) ;
1568
+ ) . build ( ) ) ;
1564
1569
} ) ;
1565
1570
1566
1571
let json = serde_json:: json!(
@@ -1573,10 +1578,11 @@ mod json_parsing_tests {
1573
1578
]
1574
1579
) ;
1575
1580
assert_matches ! ( eparser. from_json_value( json. clone( ) ) , Err ( EntitiesError :: Deserialization ( e) ) => {
1576
- expect_err( & json, & e , & ExpectedErrorMessage :: error_and_help (
1581
+ expect_err( & json, & miette :: Report :: new ( e ) , & ExpectedErrorMessageBuilder :: error (
1577
1582
r#"in parents field of `foo::"bar"`, expected a literal entity reference, but got `null`"# ,
1583
+ ) . help(
1578
1584
r#"literal entity references can be made with `{ "type": "SomeType", "id": "SomeId" }`"# ,
1579
- ) ) ;
1585
+ ) . build ( ) ) ;
1580
1586
} ) ;
1581
1587
}
1582
1588
0 commit comments