Cancel document viewing in ASP.NET Core

Hi,

Is there any way to cancel document rendering in ASP.NET Core?
Cancel rendering | Documentation (groupdocs.com)

For example if there’s issue in the document, and we’d like to cancel it within IFileStorage.ReadFileAsync (or if there’s any other means).

Thank you.

@Bipo

Can you please clarify if you’re asking about GroupDocs.Viewer-for-.NET-UI?

Hi Vladimir,

Yes, correct.

@Bipo

Cancellation is not implemented in GroupDocs.Viewer-for-.NET-UI. Cancelling tasks typically implemented by passing CancellationToken.

Do you expect to have a method that accepts CancellationToken as a parameter?

Hi Vladimir,

Basically our scenario is like this: the document file is fetched from external API (this happens in IFileStorage.ReadFileAsync). There could be error or exception from this fetching. So we would like to render our custom message and view, instead of rendering GroupDoc Viewer view.
Please advise if this can be done.

Thank you.

@Bipo

Thank you for the clarification. We’ll take a look and update you.

@Bipo

At the moment the client app handles all the unsuccessful responses and shows a modal with the error message that comes in response. Even if you return redirect it will be handled but you won’t be redirected. We’ll consider implementing error handling in a such way so the users can manage the client app behavior.