Skip to content
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

Closed
gvheertum opened this issue Jun 25, 2019 · 6 comments

Comments

@gvheertum
Copy link
Member

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).

@mrbean-bremen
Copy link
Member

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

Good idea - are you planning to provide a PR for this?

I saw @mrbean-bremen already doing some additions to the help files

Do you mean the Q&A section in the Wiki? Yes, I can add a related entry there, good point.

@gvheertum
Copy link
Member Author

gvheertum commented Jun 26, 2019 via email

@mrbean-bremen
Copy link
Member

@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...

@mrbean-bremen
Copy link
Member

@gvheertum - this has finally been merged to master. Are you still working on this?

@gvheertum
Copy link
Member Author

@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.

@mrbean-bremen
Copy link
Member

Ah, so you have write access to the Wiki - good to know, I wasn't sure about this :) And thanks for the documentation update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants