Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3D62BEE67 for ; Tue, 12 Feb 2013 03:14:39 +0000 (UTC) Received: (qmail 3596 invoked by uid 500); 12 Feb 2013 03:14:39 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 3386 invoked by uid 500); 12 Feb 2013 03:14:38 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 2698 invoked by uid 99); 12 Feb 2013 03:14:35 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 03:14:35 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C06845101F; Tue, 12 Feb 2013 03:14:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agrieve@apache.org To: commits@cordova.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [2/13] ios commit: [CB-2213] Updated errors for write and truncate. Message-Id: <20130212031434.C06845101F@tyr.zones.apache.org> Date: Tue, 12 Feb 2013 03:14:34 +0000 (UTC) [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 Authored: Thu Jan 17 15:51:25 2013 -0500 Committer: Andrew Grieve 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; }