Suggestion - warnings for small errors loading document

Hi,

I had an issue where a customer had a Word document with some reference issue with regards to a footnote. This resulted in an exception while loading the document. Error: “Unable to find footnote reference mark.”. This was easily solved, by changing the document, but it required a developer to look at a stack trace to figure it out, which is not the best user experience. I’m not too keen on just pushing the exception message to the UI, so I would like to suggest a better way to handle this (or enlighten me if I’ve missed an existing feature in the product).

Small errors like this, that do not affect the presentation of the document at large, should be reported as warnings rather than trigger an exception, such that we can both show the document and present the warning message to the user (I don’t know if there is a good way for this to work with text localization, but that’s beyond the scope of this post). Maybe this could hook into the whole IWarningCallback infrastructure, though I haven’t looked into that, so I don’t know how appropriate this would be.

I don’t know if you’ve got anything like this planned, but I think it would be very useful for avoiding many of the errors with unsupported or malformed documents.

Regards,
Morten Christiansen

Hi
Thanks for your request. Yes, we already added IWarningCallback in the recently released version of Aspose.Words. It allows you to get a warning when a problem encountered upon saving or loading document.
https://reference.aspose.com/words/net/aspose.words/iwarningcallback/
But anyways, could you please attach the document that causes an exception on your side? We will check it and provide you more information. It is simply impossible to know all invalid cases that can occur in documents.
Best regards,

Hi

The document in question was just an example, it was in a strange state and I understand why there was an error.

I’m opening a word document to save it as XPS for rendering in Silverlight and the behavior I would like for the Aspose component to have is to ignore the error and allow me to render the document as if nothing had happened. It should simply ignore the part of the document with the error, in this case the foot note, and output a sensible warning message (preferably in a way that I can localize for other languages).

Sincerely,
Morten Christiansen

Hi Morten,
Thank you for additional information. I do not think that we can ignore all possible problems with the documents. There can be cases that we simply do not expect. So in such cases Aspose.Words throws an exception. But in most of cases, Aspose.Words is silent and resolves or ignores the problems.
So if you find a document that causes Aspose.Words to throw an exception, it would be great if you attach it here for testing. This will allow us to make Aspose.Words more fault-tolerance.
Best regards,

Hi

That makes sense. In this case, it just seemed like a more or less expected error, due to the error message I got, but never mind that. Here is the document that caused the error, though I don’t know how the document actually got into the state it’s in.

Sincerely,
Morten Christiansen

Hi Morten,
Thank you for reporting this problem to us and for the additional information. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed.
Best regards,

The issues you have found earlier (filed as WORDSNET-5245) have been fixed in this .NET update and in this Java update.

The issues you have found earlier (filed as WORDSNET-5323) have been fixed in this .NET update and in this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.