mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
PhoneGap Android Ticket 113:
FileTransfer returns FILE_NOT_FOUND_ERR on http 500 error For some reason on Android if you do a getInputStream() on a HTTP Connection and the server returns a 500 error it will report a FileNotFoundException. Catching this exception and throwing an IOException so that we can report a more accurate error in JavaScript.
This commit is contained in:
parent
b3e9794189
commit
969f0c87d7
@ -315,7 +315,13 @@ public class FileTransfer extends Plugin {
|
||||
|
||||
//------------------ read the SERVER RESPONSE
|
||||
StringBuffer responseString = new StringBuffer("");
|
||||
DataInputStream inStream = new DataInputStream ( conn.getInputStream() );
|
||||
DataInputStream inStream;
|
||||
try {
|
||||
inStream = new DataInputStream ( conn.getInputStream() );
|
||||
} catch(FileNotFoundException e) {
|
||||
throw new IOException("Received error from server");
|
||||
}
|
||||
|
||||
String line;
|
||||
while (( line = inStream.readLine()) != null) {
|
||||
responseString.append(line);
|
||||
|
Loading…
Reference in New Issue
Block a user