Skip to content

Handle bad internet connection #74

@flacial

Description

@flacial

Problem

The CLI depends on an active internet connection, when there isn't, it throws an unhandled error. To handle this scenario gracefully, we can display an error message when the network connection is lost.

Optional: add a check for the network connection before sending any requests, and show an appropriate message if the connection is not available.

How to reproduce

Close your internet connection and run c0d3 login

Expected behavior

$ npx c0d3 login

✔ Username: user
✔ Password: 4321

Oops, looks like we're having trouble connecting to our servers. It's possible your internet connection is playing hard to get. Make sure you're connected to a strong and stable internet connection and check if any sneaky firewalls or internet settings are getting in the way. If you're still having issues, don't sweat it - just give us a shout and we'll help you get things sorted!

Please create an issue about it with a way to reproduce it in https://github.com/garageScript/c0d3-cli/issues

Actual behavior

$ npx c0d3 login
✔ Username: user
✔ Password: 4321
✖ Unhandled error. Please create an issue about it with a way to reproduce it in https://github.com/garageScript/c0d3-cli/issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions