Skip to content

Nicer error message (again) for Data(contentsOf:) + http #5218

@stefanspringer1

Description

@stefanspringer1

When getting data via Data(contentsOf:) and using an http-URL on Linux and Windows and not using the (conditional) import FoundationNetworking, the error message (with e.g. Swift 6.1.1) is

The specified URL type isn’t supported.

whereas with Swift 5.10 (tested on Linux) you got the message

Fatal error: You must link or load module FoundationNetworking to load non-file: URL content using String(contentsOf:…), Data(contentsOf:…), etc

which was so much nicer because it gave you a hint what to do.

The old error message should be used again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions