GenericError when stream is OwnStream is set to false

Discussions about DocuVieware integration in GdPicture.NET.
Post Reply
lchorley
Posts: 19
Joined: Tue Mar 22, 2022 3:10 pm

GenericError when stream is OwnStream is set to false

Post by lchorley » Fri Feb 02, 2024 4:21 pm

Hello team DocuVieware,

We recently encountered a "GenericError" and identified the modification that caused it. We were wondering if you had any ideas on why it happens. We thought, in sending you a message, at best we could improve something, at worst we could learn something :)

We can't give you a reproduction, but we can describe the contexte in case you feel like trying to do a repro:
Running locally on a windows machine from Visual Studio in a ASP.Net cshtml .NET6 project I don't have any problem.
It's only once that project is packed up into a docker image and deployed to an AKS in Azure that the problem occurs (container's base image : mcr.microsoft.com/dotnet/aspnet:6.0)
The document that produced the error was a super simple docx with just a single line of text, though we're not convinced that this is at fault.

The code that produced the problem is the following, though we haven't tested it in isolation, so were not sure that this is sufficient. Though we can't imagine that anything else could be at fault.

The only changes are the two sets of [.../...]. If the using is in place in the method GetStream, and the boolean (OwnStream) is set to false, then status is GenericError. If there is no using on the Stream, and the parameter is true, then all is well.

Code: Select all

    public async Task<bool> GetStream(Uri uri, Action<Stream> callback)
    {
        try
        {
            using HttpResponseMessage result = await _httpClient.GetAsync(uri);
            [using/] Stream stream = await result.Content.ReadAsStreamAsync();

            if (result.StatusCode != HttpStatusCode.OK)
            {
                return false;
            }

            callback(stream);

            return true;
        }
        catch (TaskCanceledException)
        {
            return false;
        }
    }
	
var status;
bool success = await GetStream(AddressAsUri, documentStream =>
{
	status = docuVieware.LoadFromStream(documentStream, [false/true], DocumentName);
});

Thank you and looking forward to hearing what you think,

Loren

myrnaed
Posts: 1
Joined: Thu Mar 21, 2024 11:09 am

Re: GenericError when stream is OwnStream is set to false

Post by myrnaed » Thu Mar 21, 2024 11:12 am

I am encountering the same error. Did you find the solution?
geometry dash scratch

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest