From 78097d25b0168b2adc5a4858d4544326d4202413 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Mon, 20 Jun 2016 06:38:05 +0000 Subject: [PATCH] Improve error message git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39884 72102866-910b-0410-8b05-ffd578937521 --- Source/NSString.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/NSString.m b/Source/NSString.m index 22de9793c..b9ba7196d 100644 --- a/Source/NSString.m +++ b/Source/NSString.m @@ -1494,7 +1494,8 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale) RELEASE(d); if (self == nil) { - NSWarnMLog(@"Contents of file '%@' are not string data", path); + NSWarnMLog(@"Contents of file '%@' are not string data using %@", + path, [NSString localizedNameOfStringEncoding: enc]); } return self; } @@ -1667,7 +1668,8 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale) self = [self initWithData: d encoding: enc]; if (self == nil) { - NSWarnMLog(@"Contents of URL '%@' are not string data", url); + NSWarnMLog(@"Contents of URL '%@' are not string data using %@", + url, [NSString localizedNameOfStringEncoding: enc]); } return self; } @@ -6033,13 +6035,16 @@ static NSFileManager *fm = nil; } NS_HANDLER { + error = [NSString stringWithFormat: + @"as property list {%@}, and as strings file {%@}", + error, [localException reason]]; result = nil; } NS_ENDHANDLER if (result == nil) { [NSException raise: NSGenericException - format: @"Parse failed - %@", error]; + format: @"Parse failed - %@", error]; } } return result;