function convertExitToOurStyle<
A,
E extends { _tag: string }, //internally enforce all errors must be tagged
TheExit extends Exit.Exit<A, E>
>(theExit: TheExit) {
if (theExit._tag === "Success") {
return { value: theExit.value, failure: null };
}
if (theExit.cause._tag !== "Fail") {
return { value: null, failure: "Unexpected error" as const };
}
return { value: null, failure: theExit.cause.error._tag };
}
function convertExitToOurStyle<
A,
E extends { _tag: string }, //internally enforce all errors must be tagged
TheExit extends Exit.Exit<A, E>
>(theExit: TheExit) {
if (theExit._tag === "Success") {
return { value: theExit.value, failure: null };
}
if (theExit.cause._tag !== "Fail") {
return { value: null, failure: "Unexpected error" as const };
}
return { value: null, failure: theExit.cause.error._tag };
}