Skip to content

fix(pic): include request path in PocketIC server error messages (#70)#249

Merged
nikosxenakis merged 3 commits intomainfrom
nikosxenakis/issue-70-server-error-include-path
Mar 11, 2026
Merged

fix(pic): include request path in PocketIC server error messages (#70)#249
nikosxenakis merged 3 commits intomainfrom
nikosxenakis/issue-70-server-error-include-path

Conversation

@nikosxenakis
Copy link
Copy Markdown
Contributor

Motivation

When a PocketIC instance is deleted while async operations are still in-flight, the resulting "Instance was deleted"
error provides no context about which call was orphaned, making it hard to track
down the offending line.

Closes #70

Summary

  • Include the request path in ServerError messages thrown by jsonGet and jsonPost in the HTTP client, e.g. PocketIC server error: Instance was deleted (/api/v2/instances/0/read/query)

@nikosxenakis nikosxenakis requested a review from a team as a code owner March 11, 2026 09:31
Copilot AI review requested due to automatic review settings March 11, 2026 09:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves PocketIC client diagnostics by including the HTTP request path in ServerError messages emitted from the HTTP2 client, making it easier to identify which in-flight request failed (e.g., after an instance is deleted).

Changes:

  • Append init.path to ServerError messages thrown on { message: ... } error responses in jsonGet.
  • Append init.path to ServerError messages thrown on { message: ... } error responses in jsonPost.
  • Update the Http2Client unit test expectation for jsonGet error messaging.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/pic/src/http2-client.ts Adds request path context to ServerError messages for error responses in jsonGet/jsonPost.
packages/pic/tests/src/util/http2-client.spec.ts Updates jsonGet error-response test to match the new error message format.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/pic/src/http2-client.ts
@nikosxenakis nikosxenakis added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit 48300f7 Mar 11, 2026
14 checks passed
@nikosxenakis nikosxenakis deleted the nikosxenakis/issue-70-server-error-include-path branch March 11, 2026 09:48
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.

More info on hanging https calls

3 participants