Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhanced details in agent call errors #968

Merged
merged 6 commits into from
Feb 4, 2025

Conversation

krpeacock
Copy link
Contributor

@krpeacock krpeacock commented Jan 30, 2025

Description

Motivated partially by efforts to find the root of the mysterious "invalid signature" errors, but also to enhance developer experience in general, this will provide useful information for debugging purposes included in the Error thrown from a failed call.

Now includes:

  • response
  • requestId (hex)
  • sender_pubkey (hex)
  • sender_sig (hex)
  • ingress_expiry (string)

New response:

{
  message:
    "Error while making call: Server returned an error:\\n  Code: 400 (Bad Request)\\n  Body: Invalid signature: Invalid basic signature: Ed25519 signature could not be verified: public key 3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29, signature 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, error: A signature was invalid\\n\\n",
  level: "error",
  error: {
    name: "AgentCallError",
    response: {
      name: "AgentError",
      response: {
        ok: false,
        status: 400,
        statusText: "Bad Request",
        headers: [
          [0, ["access-control-allow-origin", "*"]],
          [1, ["content-length", "332"]],
          [2, ["content-type", "text/plain; charset=utf-8"]],
          [3, ["date", "Fri, 31 Jan 2025 18:53:47 GMT"]],
        ],
      },
    },
    requestId:
      "a920e72ef37aeffac8fa8d8d11a85886e6fea2490446a19b4a62568cd51a4f70",
    sender_pubkey:
      "302a300506032b65700321003b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29",
    sender_sig:
      "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    ingress_expiry: "1738362720000000000",
  },
};

Fixes SDK-1952

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Checklist:

  • My changes follow the guidelines in CONTRIBUTING.md.
  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@krpeacock krpeacock requested a review from a team as a code owner January 30, 2025 23:59
Copy link
Contributor

github-actions bot commented Jan 31, 2025

size-limit report 📦

Path Size
@dfinity/agent 72.45 KB (+0.1% 🔺)
@dfinity/candid 11.65 KB (0%)
@dfinity/principal 4.16 KB (0%)
@dfinity/auth-client 50.33 KB (0%)
@dfinity/assets 67.92 KB (0%)
@dfinity/identity 47.94 KB (0%)
@dfinity/identity-secp256k1 106.63 KB (+0.2% 🔺)

@krpeacock krpeacock merged commit 28be7e2 into main Feb 4, 2025
17 checks passed
@krpeacock krpeacock deleted the kaia/SDK-1952-enhanced-call-errors branch February 4, 2025 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants