incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michal Mocny (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-1244) File Errors are not consistent in Docs/Examples
Date Thu, 16 Aug 2012 15:55:38 GMT

    [ https://issues.apache.org/jira/browse/CB-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436051#comment-13436051
] 

Michal Mocny commented on CB-1244:
----------------------------------

The filesystem api failure callbacks get a FileError object directly, exactly as the mobile
spec tests.

The only place I've found so far where failure callbacks get an object with a target FileError
is the FileReader onerror (gets a ProgressEvent), and none of the docs examples are showing
this case.

The docs seem like they could use a bit of cleanup in general.

First attempt at a docs fix:
https://github.com/mmocny/incubator-cordova-docs/compare/master...fix_documentation_fs_fail_handler

This only updates en 2.0.0 .md files -- likely still need to update other lang/versions and
autogen html.
                
> File Errors are not consistent in Docs/Examples
> -----------------------------------------------
>
>                 Key: CB-1244
>                 URL: https://issues.apache.org/jira/browse/CB-1244
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Docs
>    Affects Versions: 2.0.0
>            Reporter: Jesse MacFadyen
>            Assignee: Michal Mocny
>             Fix For: 2.1.0
>
>
> The result of File API calls are not clearly defined:
> Some document examples expect the error handler to receive a full fledged object with
a target of a FileError object.
> ex. 
> {code:javascript}
> function fail(evt) {
>         console.log(evt.target.error.code);
>     }
> {code}
> The mobile spec tests specifically test that the returned object is a FileError object
:
> ex. 
> {code:javascript}
> expect(error).toBeFileError(FileError.NOT_FOUND_ERR);
>  toBeFileError: function(code) {
>                 var error = this.actual;
>                 this.message = function(){
>                     return "Expected FileError with code " + fileErrorMap[error.code]
+ " (" + error.code + ") to be " + fileErrorMap[code] + "(" + code + ")";
>                 };
>                 return (error.code == code);
>             }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message