xabber-android icon indicating copy to clipboard operation
xabber-android copied to clipboard

http_upload: Improve error message

Open casperklein opened this issue 8 years ago • 0 comments

Currently, on every error the user see "Could not upload file. Too large?"

But there can be of course other errors, e.g.:

2017-04-16_00-27-44 D/Smack? RECV (2): <iq id='Bf77q-515' type='error' to='[email protected]/xabber' from='domain.tld'><error type='modify'><bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>MIME type does not match file extension</text></error></iq>

In that case, the message "MIME type does not match file extension" is more useful than "... Too large?".

edit: A disadvantage would be, that if the string is taken from the server response, it cannot be translated. IMHO a concrete error message in the wrong language is better than a general, perhaps misleading one. Feel free to close the issue if you think different :)

casperklein avatar Apr 15 '17 23:04 casperklein