Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Exceptions not handled in code on "Creating a Stream on an HTTP Source" #244

Copy link
Copy link
@authentictech

Description

@authentictech
Issue body actions

In Learn -> The Stream API -> Creating Streams, the "Creating a Stream on an HTTP Source" section, I found that the compiler complains about some exceptions not being handled:

HttpResponse<Stream<String>> response = client.send(request, HttpResponse.BodyHandlers.ofLines());

Here, the compiler wants to handle IOException and InterruptedException.

Having put the above in the try block, the compiler complained about response not being initialised.

The compiler also complained about lines not being initialised below this.

In both cases, I initialised them to null outside of the try blocks, which seemed OK.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.