cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [2/13] ios commit: [CB-2213] Updated errors for write and truncate.
Date Tue, 12 Feb 2013 03:14:34 GMT
[CB-2213] Updated errors for write and truncate.


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/2f6bb31d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/2f6bb31d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/2f6bb31d

Branch: refs/heads/master
Commit: 2f6bb31df725329307d8e368024b011dcd76d8a3
Parents: e9a1f8e
Author: Max Woghiren <max.woghiren@gmail.com>
Authored: Thu Jan 17 15:51:25 2013 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Mon Feb 11 21:06:23 2013 -0500

----------------------------------------------------------------------
 CordovaLib/Classes/CDVFile.m |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2f6bb31d/CordovaLib/Classes/CDVFile.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVFile.m b/CordovaLib/Classes/CDVFile.m
index b4ae7d4..48dbc34 100644
--- a/CordovaLib/Classes/CDVFile.m
+++ b/CordovaLib/Classes/CDVFile.m
@@ -1237,9 +1237,9 @@ NSString* const kCDVAssetsLibraryPrefix = @"assets-library://";
     NSString* argPath = [command.arguments objectAtIndex:0];
     unsigned long long pos = (unsigned long long)[[command.arguments objectAtIndex:1] longLongValue];
 
-    // return unsupported result for assets-library URLs
+    // assets-library files can't be truncated
     if ([argPath hasPrefix:kCDVAssetsLibraryPrefix]) {
-        CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_MALFORMED_URL_EXCEPTION
messageAsString:@"truncate not supported for assets-library URLs."];
+        CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION
messageAsInt:NO_MODIFICATION_ALLOWED_ERR];
         [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
         return;
     }
@@ -1284,9 +1284,9 @@ NSString* const kCDVAssetsLibraryPrefix = @"assets-library://";
     NSString* argData = [arguments objectAtIndex:1];
     unsigned long long pos = (unsigned long long)[[arguments objectAtIndex:2] longLongValue];
 
-    // return unsupported result for assets-library URLs
+    // text can't be written into assets-library files
     if ([argPath hasPrefix:kCDVAssetsLibraryPrefix]) {
-        CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_MALFORMED_URL_EXCEPTION
messageAsString:@"write not supported for assets-library URLs."];
+        CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION
messageAsInt:NO_MODIFICATION_ALLOWED_ERR];
         [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
         return;
     }


Mime
View raw message