mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 11:30:48 +00:00
Better support for setting errors inside -dataOfType:error: and -readFromData:ofType:error:.
Previously, under GNUstep, NSLocalizedFailureReasonKey was ignored when presented with +[NSAlert alertWithError]. Additionally, error set in -readFromData:ofType:error: was overwritten by two different methods in the file reading chain. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38483 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
acf05990fa
commit
daa905a169
3 changed files with 24 additions and 4 deletions
|
@ -641,8 +641,9 @@ withContentsOfURL: (NSURL *)url
|
|||
|
||||
if (data == nil)
|
||||
{
|
||||
*error = create_error(0, NSLocalizedString(@"Could not create data for type.",
|
||||
@"Error description"));
|
||||
if (error && !(*error))
|
||||
*error = create_error(0, NSLocalizedString(@"Could not create data for type.",
|
||||
@"Error description"));
|
||||
return nil;
|
||||
}
|
||||
return AUTORELEASE([[NSFileWrapper alloc] initRegularFileWithContents: data]);
|
||||
|
@ -1022,7 +1023,7 @@ withContentsOfURL: (NSURL *)url
|
|||
error: error];
|
||||
if (wrapper == nil)
|
||||
{
|
||||
if (error)
|
||||
if (error && !(*error))
|
||||
{
|
||||
*error = create_error(0, NSLocalizedString(@"Could not write file wrapper.",
|
||||
@"Error description"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue