Giter Site home page Giter Site logo

Comments (8)

xperiandri avatar xperiandri commented on June 13, 2024 1

As long as it is a FSharp.Core issue I propose to use a corrected way of awaiting tasks
https://github.com/jet/FsKafka/blob/6c6186f822a221adf0ad06e8a44a392aa55aa8ec/src/FsKafka/Infrastructure.fs#L14 instead of Async.AwaitTask

from fstoolkit.errorhandling.

TheAngryByrd avatar TheAngryByrd commented on June 13, 2024 1

Hey @NinoFloris see any downsides to doing this?

from fstoolkit.errorhandling.

TheAngryByrd avatar TheAngryByrd commented on June 13, 2024

I don't think this is a problem with FsToolkit as this is how exceptions are thrown with Tasks via .NET https://docs.microsoft.com/en-us/dotnet/standard/parallel-programming/exception-handling-task-parallel-library

from fstoolkit.errorhandling.

xperiandri avatar xperiandri commented on June 13, 2024

Is it how async CE works itself?

from fstoolkit.errorhandling.

xperiandri avatar xperiandri commented on June 13, 2024

It does not happen with await in C#

from fstoolkit.errorhandling.

xperiandri avatar xperiandri commented on June 13, 2024

Ah, this is the issue fsharp/fslang-suggestions#840

from fstoolkit.errorhandling.

njlr avatar njlr commented on June 13, 2024

I have this helper in various code-bases:

let rec unpackException (exn : Exception) = 
  match exn with
  | :? AggregateException as agg -> 
    match Seq.tryExactlyOne agg.InnerExceptions with
    | Some x -> unpackException x
    | None -> exn
  | _ -> exn

from fstoolkit.errorhandling.

bartelink avatar bartelink commented on June 13, 2024

As long as it is a FSharp.Core issue I propose to use a corrected way of awaiting tasks https://github.com/jet/FsKafka/blob/6c6186f822a221adf0ad06e8a44a392aa55aa8ec/src/FsKafka/Infrastructure.fs#L14 instead of Async.AwaitTask

Note the edition therein in being synced with the canonical one in jet/FsKafka#92 (similarly fsprojects/FSharp.AWS.DynamoDB#49)

The key specific diff in there is that cancellation will be guaranteed yield an exception, but the more important effect is that people debugging systems can do that based on being able to assume-but-verify identical behavior vs the needless variation having slight variations can cause (especially if we do manage to converge in the end).

from fstoolkit.errorhandling.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.