Skip to content

Improve Error Handling : annotation-processor #43728

Open
@samvaity

Description

@samvaity

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));
        }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions