Skip to content

useFetch with invalid URL #64

@CzBiX

Description

@CzBiX

Description

When an invalid URL is passed to useFetch, it throws an exception directly. This error isn't captured in the returned error field, nor can it be handled via the provided onError callback.
Throwing exceptions in react hooks also goes against best practices.

Steps To Reproduce

call useFetch with invalid URL,such as http://:8080

Current Behaviour

Throw an exception about invalid URL

Expected Behaviour

return the error in error or pass it into onError

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