Skip to content

Code Optimization and Error Handling in general.py #27

Open
@Mefisto04

Description

The general.py file needs several improvements:

  1. Error Handling Improvements:

    • The request and arequest functions use VQLError for logging, but specific error handling for different HTTP statuses can enhance clarity. Include more details in logs, like response body content.
  2. Code Duplication:

    • The logic in request and arequest is nearly identical. Refactoring this common logic into a separate function would reduce redundancy.
  3. Efficiency in Image Encoding:

    • In the encode_image function, check if the input image is already in the desired format to avoid unnecessary conversions. Implement graceful error handling for unsupported formats.

Please assign me this issue so that i can contribute in it.

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions