New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When gdi+ cannot be loaded on MacOs or Linux the system should give a more descriptive exception #501
Comments
Good idea - are you planning to provide a PR for this?
Do you mean the Q&A section in the Wiki? Yes, I can add a related entry there, good point. |
Great, I’ll try to put it in there and make a PR.
I will also try to propose some additions/changes to the documentation if required (but first I’ll have to do some reading).
|
@gvheertum - I added a prelimary entry to Q&A yesterday, you can adapt it later. I'm not sure if you can edit the Wiki yourself, though... |
@gvheertum - this has finally been merged to master. Are you still working on this? |
@mrbean-bremen I just pushed a new PR ( #511 ) with some revisions in the check (based on remarks by @H1Gdev ). I also updated the wiki to reflect the situation since version 3 and a small instruction how to validate/ensure capabilities for the developer. |
Ah, so you have write access to the Wiki - good to know, I wasn't sure about this :) And thanks for the documentation update! |
As found in PR #495 loading problems regarding gdi+ on MacOs and Linux will often result in a confusing exception. Depending on the entry point to the SVG library the user will sometimes not be presented with an error, but will get a null reference to the document.
When on a MacOs system a call is done to library classes like SvgText, we will get a TypeInitializationException, while calls to the SvgDocument.Load(xml) will yield a null as result and will likely cause nullpointer exceptions lateron, when the user works with the document reference.
I propose that at least in the SvgDocument.Load() we watch for the type exceptions and wrap the exception stating the current requirements regarding the gdi+ on MacOs and Linux. Catching calls in all Svg classes (like SvgText) is undoable, so I suggest leaving that there. These will directly result in the type errors, which can be documents (and I saw @mrbean-bremen already doing some additions to the help files, so maybe we can also add the error thrown in that case so people can find it more easily via search engines and github).
The text was updated successfully, but these errors were encountered: