The shape of what failed
With an error, the SDK sends what the failing code was given as key names and types, never values, so the fixer can write a test that fails the same way.
A stack trace says where an error happened. Often the cause is what came in: an order with no items, an empty coupon, a quantity that isn't a number. So with each error the SDK sends the shape of its input.
{body: {items: undefined, coupon: "", lines: [{sku: string, qty: number}]}}That's key names and types. Never a value: a string is string (or "" when it's empty), a number is number (or NaN), whatever it was.
Where it's used#
- The fixer writes its failing test with input of this shape first, so the fix is proven against what really happened, not a guess.
- The problem page shows it under What it was given, with up to three different shapes the same error came with, newest first. When it fails with
items: undefinedand never withitems: [..], that's the cause. - Your AI tools read it from
get_problem(Use it from your AI tools).
Where it comes from#
The framework hooks send the request's route params, query and body by themselves:
app.use(controxity.express()); // and fastify(app), nest(app)For your own code, pass what it was given:
controxity.captureError(error, { where: "checkout", input: { cart, coupon } });controxity.capture_error(error, where="checkout", input={"cart": cart, "coupon": coupon})What's never in it#
| Given | Sent |
|---|---|
"[email protected]" | string |
4111111111111111 | number |
{"[email protected]": {...}} (keyed by data) | {[key]: {...}} |
true | boolean |
A key that looks like data (an email, a long number, an id or a token) isn't kept: it becomes [key]. A shape stops at 6 levels deep and 150 parts, and at 30 keys in one object.
Controxity checks every shape again when it arrives: it keeps only objects of name-like keys and type words from a fixed list, so a value sent by mistake is dropped and never stored.
Turning it off#
controxity.init({ key, url, captureInput: false });controxity.init(key, url, capture_input=False)Errors are reported as before, without their input.