Provide a better error message when the server is incorrectly configured
Here are the possible causes of connection problems:
API endpoint is not correct
Sometimes, users don't follow documentation when installing and expose
/p's parent directory resulting in api endpoint to be
/p/api and not
How to detect: if lucky, (we should check how FreshRSS is developped), /api returns a specific error or HTTP code that indicates exposed path is
/p and not
/. Otherwise, we may automatically test
/p/api. to detect this error.
How to solve: test if
/p/api is what we expect and propose the user to automatically change to
API password not set
How to detect: When password is not set, the API seems to respond 401 unauthorized on
/api/accounts/ClientLogin. We should check if this error is specific enough to be considered an "API password is not set" error. In particular, it should not be mistaken with an Apache/Nginx misconfiguration.
How to solve: Open browser at
/i/?c=user&a=profile and ask user to set a password.
HTTP cleartext traffic is disallowed
How to detect: The error happens before any web request is emitted so there's not HTTP error related to this. The exception thowed by Fuel is generic but the message is specific:
Cleartext HTTP traffic to <domain> not permitted. So the error can be detected this way.
How to solve: This is unhopefully unsolvable on the client side. This is an administration problem. The owner of the instance needs to securize connection with TLS certificate.