Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.9.4
-
None
Description
If you include invalid JSON in the Q_PLUGIN_METADATA, then the plugin will fail to load.
Asking QPluginLoader for the errorString() just gives us:
"<path>/foo.dylib is not a Qt plugin"
This is very confusing to plugin developers because it's so easy to get JSON slightly wrong (extra commas!).
Is there any way to find out that it failed because of invalid JSON? I don't think we would even need the actual error or the line number - just that this was the cause.
Possible actions:
1) Have it set the QPluginLoader error message to something more useful like "<path>/foo.dylib contains invalid meta data"
2) Output a warning to the console if the loader encounters invalid meta data
3) Load the plugin anyways and return empty meta data or a JSON file with an error message in it when it's asked for?
4) <some other awesome solution>