mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 11:42:30 +00:00
More verbose error reporting in PluginManager
This commit is contained in:
@@ -92,23 +92,34 @@ NSString *const MPPluginManagerPluginBundleIdentifiyerKey = @"MPPluginManagerPlu
|
|||||||
|
|
||||||
NSBundle *pluginBundle = [NSBundle bundleWithURL:pluginURL];
|
NSBundle *pluginBundle = [NSBundle bundleWithURL:pluginURL];
|
||||||
if(!pluginBundle) {
|
if(!pluginBundle) {
|
||||||
|
NSLog(@"Could not create bundle %@", pluginURL.path);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
NSError *error;
|
NSError *error;
|
||||||
if(![pluginBundle preflightAndReturnError:&error]) {
|
if(![pluginBundle preflightAndReturnError:&error]) {
|
||||||
NSLog(@"%@", error.localizedDescription );
|
NSLog(@"Preflight Error %@ %@", error.localizedDescription, error.localizedFailureReason );
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(![pluginBundle loadAndReturnError:&error]) {
|
||||||
|
NSLog(@"Bunlde Loading Error %@ %@", error.localizedDescription, error.localizedFailureReason);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if(![self _validateClass:pluginBundle.principalClass]) {
|
if(![self _validateClass:pluginBundle.principalClass]) {
|
||||||
|
NSLog(@"Wrong principal Class.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
MPPlugin *plugin = [[pluginBundle.principalClass alloc] initWithPluginManager:self];
|
MPPlugin *plugin = [[pluginBundle.principalClass alloc] initWithPluginManager:self];
|
||||||
if(plugin) {
|
if(plugin) {
|
||||||
|
NSLog(@"Loaded plugin instance %@", pluginBundle.principalClass);
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPPluginManagerWillLoadPlugin object:self userInfo:@{ MPPluginManagerPluginBundleIdentifiyerKey : plugin.identifier }];
|
[[NSNotificationCenter defaultCenter] postNotificationName:MPPluginManagerWillLoadPlugin object:self userInfo:@{ MPPluginManagerPluginBundleIdentifiyerKey : plugin.identifier }];
|
||||||
[self.mutablePlugins addObject:plugin];
|
[self.mutablePlugins addObject:plugin];
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPPluginManagerDidLoadPlugin object:self userInfo:@{ MPPluginManagerPluginBundleIdentifiyerKey : plugin.identifier }];
|
[[NSNotificationCenter defaultCenter] postNotificationName:MPPluginManagerDidLoadPlugin object:self userInfo:@{ MPPluginManagerPluginBundleIdentifiyerKey : plugin.identifier }];
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
NSLog(@"Unable to instanciate instance of plugin class %@", pluginBundle.principalClass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user