Skip to content

gateway transformation run reports success for thrown errors, invalid JS, and unknown IDs #410

Description

@leggetter

Summary

gateway transformation run reports success and returns {} for every kind of failure — a thrown exception, invalid JavaScript, or a transformation ID that does not exist. Testing a transformation before shipping it is the command's entire purpose, and it cannot tell you when the transformation is broken.

Reproduce

hookdeck gateway transformation run \
  --code 'addHandler("transform",(r,c)=>{ throw new Error("boom"); });' \
  --request '{"headers":{}}' --output json
→ {}
→ exit 0

Without --output json:

✔ Transformation run completed
→ exit 0

Identical {} and exit 0 for:

  • a nonexistent transformation: --id trs_bogus000
  • syntactically invalid JavaScript

console.log output from the transformation is also not surfaced.

Expected

The runtime or compile error should be reported, and the exit code should be non-zero. A nonexistent --id should say so. Console output should be shown — it is the main way people debug a transform.

Scope

Pre-existing, not a regression. Verified identical on fbb924a (pre-#392) and on the merged branch.

Why it matters

This is the local-testing command. Someone iterating on a transformation gets a green tick whether their code works or throws, so the failure surfaces later in production delivery instead. It is the same shape as #367's note about outpost attempt get hiding the failure reason — "finding out why a delivery failed is the entire reason to run this command" — but on a different command, so filing separately.

Related


Filed by Claude on Phil's behalf, from release-candidate regression testing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions