Snippets tagged exception

  • Simple asynchronous functions

    The snippet demonstrates how to compose simple asynchronous functions and how to use try .. with to handle exceptions in asynchronous workflows.

    35 people like this

    Posted: 13 years ago by Tomas Petricek

  • Active pattern to extract HttpStatusCode from WebException

    A simple active pattern that allows you to match WebExceptions by HttpStatusCode. I find it useful for quick scripts where I only need WebClient and don't have to get involved with WebRequest etc.

    12 people like this

    Posted: 12 years ago by Leaf Garland

  • Pluggable Exception Contexts

    .Net exceptions carry with them lots of useful metadata that are not directly user modifiable. In certain applications, such as distributed or symbolic execution it might be reasonable to need to modify such metadata. The following pattern is a proposal on effectively decoupling an exception from its contextual metadata, as well as a way of defining exception hierarchies while avoiding all the ISerializable boilerplate.

    1 people like this

    Posted: 10 years ago by Eirik Tsarpalis

  • raiseAfterHandlers

    Raises an exception again after attempting to run one or more handlers. Any failures in the handlers will be put into a new AggregateExeption. If no additional errors are raised, the original exception will be re-raised with a preserved stack trace.

    4 people like this

    Posted: 13 years ago by Sebastian Good

  • MailboxProcessor with exception handling

    An extension of MailboxProcessor that catches all unhandled exceptions (in the body of the mailbox processor) and reports them using an event. Otherwise, the public interface is the same as for MailboxProcessor.

    5 people like this

    Posted: 12 years ago by Tomas Petricek

  • MailboxProcessor with exception handling and restarting

    An extension of MailboxProcessor that catches all unhandled exceptions, and ensures that the user-provided function is run repeatedly until it returns normally. Based on the HandlingMailbox defined by Tomas Petricek: fssnip.net/cj

    7 people like this

    Posted: 9 years ago by Anthony Perez