Skip to content

Instantly share code, notes, and snippets.

View jwosty's full-sized avatar

John Wostenberg jwosty

View GitHub Profile
# Jwosty's powershell profile
Import-Module 'C:\tools\poshgit\dahlbyk-posh-git-9bda399\src\posh-git.psd1'
# Start emacs in no-window mode (CLI mode)
function Private:emacs()
{
& emacs -nw $args
}
@jwosty
jwosty / AsyncFail.fs
Created July 11, 2023 19:16
F# async fail
let f (x: int) =
let y = x / 0
async {
return y
}
let g = async {
let! x = Async.Catch (f 42)
()
}
open System
open System.Diagnostics
open System.IO
open System.Runtime.ExceptionServices
module ThirdPartyLibrary =
// Represents some low-level async "primitive" which is used in many many places and which may fail. This type of
// method/function is not typically what you're interested in when examining stacktraces.
// Example: a database query function from a thid-party library
let doWorkAsync crash = ExtraTopLevelOperators.async {