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 Handling : annotation-processor #43728

Open
samvaity opened this issue Jan 7, 2025 · 0 comments
Open

Improve Error Handling : annotation-processor #43728

samvaity opened this issue Jan 7, 2025 · 0 comments
Assignees
Labels
needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team.

Comments

@samvaity
Copy link
Member

samvaity commented Jan 7, 2025

For example: Currently the impl throws a generic RuntimeException for IO errors.

try {
            return Response.create(response.getRequest(), response.getStatusCode(), response.getHeaders(), response.getValue().toObject(AudioTranscription.class));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

Could be improved to for eg:

try {
            T value = response.getValue().toObject(targetType);
            return Response.create(response.getRequest(), response.getStatusCode(), response.getHeaders(), value);
        } catch (IOException e) {
            throw LOGGER.logThrowableAsError(new IllegalStateException("Failed to deserialize response", e));
        }
@samvaity samvaity self-assigned this Jan 7, 2025
@github-actions github-actions bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team.
Projects
None yet
Development

No branches or pull requests

1 participant