ERROR
Expected failed call result.
When to use
- Use when RPC is expected to fail
- Use
partialto match only a subset of error fields - Add
with_assertsfor extra checks after error matching
Minimal example
php
--- ERROR with_asserts ---
{
"code": 3,
"message": "Invalid input"
}
--- ASSERTS ---
.code == 3
.message != nullRules
ERRORsupportspartialandwith_asserts- In strict mode (default), missing
messagein expected fails if server returns it detailsmay be omitted only when server does not returndetailswith_assertsmust be followed immediately byASSERTS- Empty
ERROR with_assertsbeforeASSERTSis accepted but warned as redundant (prefer standaloneASSERTS) - Do not combine
ERRORandRESPONSEin one file