-
Notifications
You must be signed in to change notification settings - Fork 862
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
Exception in ErrorHandler.ProcessException() #858
Comments
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue. |
@sstevenkang any chance this could be fixed? |
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue. |
@ashishdhingra do you have any estimations when this issue will be picked up for fixing? |
Stumbled on the same issue. I guess |
Reproducible using code below: namespace ConsoleTest
{
public class BrokenStream : Stream
{
public override void Flush()
{
}
public override int Read(byte[] buffer, int offset, int count)
{
throw new Exception("Oooops!");
}
public override long Seek(long offset, SeekOrigin origin)
{
throw new NotSupportedException();
}
public override void SetLength(long value)
{
throw new NotSupportedException();
}
public override void Write(byte[] buffer, int offset, int count)
{
throw new NotSupportedException();
}
public override bool CanRead => true;
public override bool CanSeek => false;
public override bool CanWrite => false;
public override long Length => 123;
public override long Position { get; set; }
}
} Program.cs using Amazon.Runtime;
using Amazon.S3.Model;
using Amazon.S3;
using ConsoleTest;
const string BucketName = "somebucket";
using (var client = new AmazonS3Client())
{
using (var myBrokenStream = new BrokenStream())
{
await WritingAnObject(client, myBrokenStream);
}
}
static async Task WritingAnObject(IAmazonS3 client, Stream inputStream)
{
try
{
var request = new PutObjectRequest
{
InputStream = inputStream,
BucketName = BucketName,
CannedACL = S3CannedACL.PublicRead,
Key = "1/temp.txt"
};
await client.PutObjectAsync(request);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
} |
Fix has been released in AWSSDK.Core 3.7.400.1 |
Comments on closed issues are hard for our team to see. |
If ErrorHandler get an exception of type
System.Exception
there will be aSystem.ArgumentNullException
with message:Here's the stacktrace:
Expected Behavior
Get original exception from ErrorHandler
Current Behavior
Possible Solution
Fix loop logic in ErrorHandler.ProcessException() if exception has type
System.Exception
Steps to Reproduce (for bugs)
I've created a repro https://github.com/xakep139/DemoS3. If you replace
Exception
with any of it subclass (here https://github.com/xakep139/DemoS3/blob/master/BrokenStream.cs#L14), the exception thrown atErrorHandler.ProcessException()
(https://github.com/aws/aws-sdk-net/blob/master/sdk/src/Core/Amazon.Runtime/Pipeline/ErrorHandler/ErrorHandler.cs#L187) will be correct.Context
Your Environment
.NET Core Info
dotnet --info
:The text was updated successfully, but these errors were encountered: