#645763 bti: no errors when server response is not valid

Package:
bti
Source:
bti
Description:
command line Twitter client
Submitter:
Vincent Lefevre
Date:
2011-10-18 20:39:03 UTC
Severity:
normal
#645763#5
Date:
2011-10-18 13:06:12 UTC
From:
To:
Currently bti doesn't work with identica:

ypig:~> bti --config .bti-identica --host identica --action friends
ypig:~>

This is because identica is down, but there should have been an error
message and the exit code should have been non-zero.

The --debug option gives more information:

ypig:~> bti --debug --config .bti-identica --host identica --action friends
bti: main: configfile = .bti-identica
bti: main: host = 1
bti: main: action = 1
bti: session_readline_init: Using libreadline.so.6 for readline library
bti - version 031
bti: main: config file = .bti-identica
bti: main: host = 1
bti: main: action = 1
bti: send_request: https://identi.ca/api/statuses/friends_timeline.xml?page=1
bti: send_request: https://identi.ca/api/statuses/friends_timeline.xml?oauth_consumer_key=xxx&oauth_nonce=xxx&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1318942941&oauth_token=xxx&oauth_version=1.0&page=1&oauth_signature=%2Fxxx%2Bc%3D
bti: send_request: <html><head><title>service unavailable</title></head><body><h1>service unavailable</h1><p>StatusNet cloud sites, including Identi.ca, are under maintenance. See <a href="http://status.net/2011/10/18/identi-ca-and-other-sites-down">status blog post</a> for details and updates.</p></body>
ypig:~>

#645763#10
Date:
2011-10-18 20:30:54 UTC
From:
To:
tag 645763 + confirmed
retitle 645763 bti: no errors when server response is not valid
thanks

Yup, that's not optimal.
Testing with identi.ca is a bit difficult now since it's working
again :)

But I can reproduce the problem (no output and exit value 0) by
setting host to any random web server, and it's the same with basic
auth and oauth.

The behaviour also doesn't depend on the HTTP response code (i.e.
both with 200 and with 403 or 404).

I guess error handling should cover both
- 4* and 5* HTTP response codes
- unparsable responses like in your example

Will discuss with upstream.


Cheers,
gregor