mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Improved error messages when loading the backend fails
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14521 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
71d95bac99
commit
0a3d708660
1 changed files with 24 additions and 6 deletions
|
@ -187,19 +187,37 @@ initialize_gnustep_backend(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME/TODO - update localized error messages. */
|
||||
|
||||
/* Backend found ? */
|
||||
NSCAssert1(path != nil,
|
||||
GSGuiLocalizedString (@"Unable to load backend %@",
|
||||
nil), bundleName);
|
||||
GSGuiLocalizedString (@"Unable to find backend %@", nil),
|
||||
bundleName);
|
||||
NSDebugLog(@"Loading Backend from %@", path);
|
||||
NSDebugFLLog(@"BackendBundle", @"Loading Backend from %@", path);
|
||||
|
||||
/* Create a bundle object. (Should normally succeed). */
|
||||
theBundle = [NSBundle bundleWithPath: path];
|
||||
NSCAssert1(theBundle != nil,
|
||||
GSGuiLocalizedString (@"Can't init backend bundle %@", nil),
|
||||
path);
|
||||
GSGuiLocalizedString
|
||||
(@"Can't create NSBundle object for backend at path %@",
|
||||
nil),
|
||||
path);
|
||||
|
||||
/* Now load the object file from the bundle. */
|
||||
NSCAssert1 ([theBundle load],
|
||||
GSGuiLocalizedString
|
||||
(@"Can't load object file from backend at path %@", nil),
|
||||
path);
|
||||
|
||||
/* Now extract the GSBackend class from the loaded bundle. */
|
||||
backend = [theBundle classNamed: @"GSBackend"];
|
||||
NSCAssert(backend,
|
||||
GSGuiLocalizedString (@"Can't load backend class", nil));
|
||||
NSCAssert1(backend != Nil,
|
||||
GSGuiLocalizedString
|
||||
(@"Backend at path %@ doesn't contain the GSBackend class",
|
||||
nil),
|
||||
path);
|
||||
[backend initializeBackend];
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue