aws icon indicating copy to clipboard operation
aws copied to clipboard

Only catch Exceptions raised in this library

Open SimonMeierIBM opened this issue 10 years ago • 0 comments

(First off, thanks for writing this library. It is very helpful.)

The code at https://github.com/aristidb/aws/blob/master/Aws/Aws.hs#L212 blindly catches all exceptions. This is suboptimal and hampers compositionality. In my code this manifests as follows.

I'm running a few web crawler threads that insert crawled documents into S3 using your library. These crawlers are terminated using by throwing ThreadKilled exceptions to them as asynchronous exceptions. As you catch all these exceptions, these threads currently continue running, which is bad.

I think it would be better if you caught only HttpExceptions and the parsing exceptions from your library. You can safely assume that all other exceptions are asynchronous ones.

SimonMeierIBM avatar May 11 '15 13:05 SimonMeierIBM