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

Fix proxy not returning errors if an image couldnt be fetched #1229

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

aaronvg
Copy link
Contributor

@aaronvg aaronvg commented Dec 11, 2024

Important

Fix proxy error handling for image fetching failures and improve logging in Rust and TypeScript code.

  • Behavior:
    • to_base64_with_inferred_mime_type() in mod.rs now returns an error if the response status is not successful, including status and response text.
    • fetch_with_proxy() in mod.rs ensures URL parsing and path extraction are handled correctly.
  • Dependencies:
    • Update mime_guess version in Cargo.toml to 2.0.5.
  • Logging:
    • Add logging in extension.ts to track proxy request handling and error scenarios.

This description was created by Ellipsis for 5afd5df. It will automatically update as commits are pushed.

Copy link

vercel bot commented Dec 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
baml ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 0:24am

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to f117ad9 in 34 seconds

More details
  • Looked at 131 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. engine/baml-runtime/src/internal/llm_client/traits/mod.rs:635
  • Draft comment:
    Missing semicolon after the to_string() method call. This will cause a syntax error.
        .to_string();
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. engine/baml-runtime/src/internal/llm_client/traits/mod.rs:670
  • Draft comment:
    The URL construction logic has been changed. Ensure that the new logic correctly appends the path to the proxy URL. The original logic was simpler and less error-prone.
  • Reason this comment was not posted:
    Comment did not seem useful.
3. typescript/vscode-ext/packages/vscode/src/extension.ts:200
  • Draft comment:
    Remove or replace console.log statements with a proper logging mechanism before merging.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The console.log statements added for debugging purposes should be removed or replaced with a proper logging mechanism before merging the PR.
4. typescript/vscode-ext/packages/vscode/src/extension.ts:215
  • Draft comment:
    Remove or replace console.log statements with a proper logging mechanism before merging. This applies to all similar instances in the file.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The console.log statements added for debugging purposes should be removed or replaced with a proper logging mechanism before merging the PR. This applies to all similar instances in the file.

Workflow ID: wflow_AuJQMQR0W0yxHzaq


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 5afd5df in 11 seconds

More details
  • Looked at 50 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. typescript/vscode-ext/packages/vscode/src/extension.ts:248
  • Draft comment:
    Consider adding logging for request and response details in the proxyRes and error event handlers to improve traceability and debugging capabilities.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions improving logging in the TypeScript code. The proxyReq event handler has a console.log statement for logging, but the proxyRes and error event handlers do not have any logging for the request or response details. Adding such logging would improve traceability and debugging capabilities.

Workflow ID: wflow_q9YX12ucIpH1zHZP


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@aaronvg aaronvg added this pull request to the merge queue Dec 11, 2024
auto-merge was automatically disabled December 11, 2024 00:28

Pull Request is not mergeable

Merged via the queue into canary with commit 7bb6df4 Dec 11, 2024
11 checks passed
@aaronvg aaronvg deleted the proxy-fixes2 branch December 11, 2024 00:33
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.

1 participant