Error handling and regeneration

When to use this

Calls fail with type errors, missing methods, or connection errors after you changed the hosted module or Gateway configuration.

Prerequisites


Exception propagation

Exceptions thrown in the receiver runtime propagate to the caller as native errors in the calling language:

try {
  await service.riskyMethod();
} catch (error) {
  // receiver exception type mapped to caller
  console.error(error);
}
try
{
    service.RiskyMethod();
}
catch (Exception ex)
{
    // handle
}

When to regenerate / reinstall Grafts

Refresh the Graft package when:

  • Public interface changed (new methods, signature changes)
  • Module version bumped on Gateway
  • --noVersioning hash changed and consumer sees identity mismatch
  • Alpha major upgrade requires Gateway + Graft refresh (see Alpha limitations)
npm update @graft/nuget-YourModule --registry=http://grft.dev/<id>__graftcode
dotnet add package graft.nuget.YourModule --source http://grft.dev/<id>__graftcode

Common errors

SymptomLikely causeFix
Method not foundStale Graft or filtered --typesReinstall Graft; check Vision
Type errors at compile timeInterface changedRegenerate/reinstall Graft
Connection failedWrong host, GG down, firewallDebugging runbook
Registration failed on GGSame version, changed interfaceBump version or --noVersioning

Verify recovery

  • After reinstall, IDE shows updated method signatures
  • Calls succeed against updated Gateway

See also