cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Iuri de Silvio (JIRA)" <>
Subject [jira] [Commented] (CB-8861) Server errors raise FILE_NOT_FOUND_ERR
Date Sat, 25 Apr 2015 20:40:38 GMT


Iuri de Silvio commented on CB-8861:

Sure! I'm using Android 4.4. I did some research to help with this issue.

When the server return anything different than a good request, Java answer for `connection.getOutputStream()`
with an `FileNotFoundException`. Check [1] for a good SO answer.

You must `getResponseCode()` before calling `getOutputStream` [2].

The problem is not with 403 errors. Most server errors can raise a `FileNotFoundException`
and you just catch this exception and answer with `FileTransferError.FILE_NOT_FOUND_ERR`.

I think the `FileNotFoundException` should return `FILE_NOT_FOUND_ERR` only if it happens
reading the file [3]. If you are able to do the request, the error code must be something
else or documentation must be changed.



> Server errors raise FILE_NOT_FOUND_ERR
> --------------------------------------
>                 Key: CB-8861
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File Transfer
>            Reporter: Iuri de Silvio
> 403 server errors cause FileTransferError.FILE_NOT_FOUND_ERR. I'm using Android 4.4.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message