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

Improve error insight for twirp related requests #390

Merged
merged 6 commits into from
Jan 25, 2025

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Jan 24, 2025

example errors with this PR:

parsing string directly from body (non standard twirp error response).
Using a wrong secret key:

Unauthorized: invalid token: eyJhbGciOiJIUzI1NiJ9.xxxxx.LXnIYsbn6clLx0sixhWnGh-v0SI82Teb656awscYvGc, error: go-jose/go-jose: error in cryptographic primitive
    at TwirpRpc.request (./livekit-server-sdk/dist/TwirpRPC.js:46:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async RoomServiceClient.createRoom (./livekit-server-sdk/dist/RoomServiceClient.js:40:18)
    at async request (./examples/webhooks-http/webhook.js:32:18) {
  status: 401,
  code: undefined
}

parsing json from body (standard twirp error response).
Using unsupported values:

Bad Request: the json request could not be decoded
    at TwirpRpc.request (./livekit-server-sdk/dist/TwirpRPC.js:51:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async RoomServiceClient.createRoom (./livekit-server-sdk/dist/RoomServiceClient.js:40:18)
    at async request (./examples/webhooks-http/webhook.js:32:18) {
  status: 400,
  code: 'malformed'
}

Copy link

changeset-bot bot commented Jan 24, 2025

🦋 Changeset detected

Latest commit: 4f96423

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
livekit-server-sdk Minor
agent-dispatch Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lukasIO lukasIO requested a review from davidzhao January 24, 2025 14:15
Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fantastic work Lukas!

@lukasIO lukasIO merged commit 473c46b into main Jan 25, 2025
10 checks passed
@lukasIO lukasIO deleted the lukas/better-error-insight branch January 25, 2025 19:29
@github-actions github-actions bot mentioned this pull request Jan 25, 2025
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