effect icon indicating copy to clipboard operation
effect copied to clipboard

Better error handling for `T.tryCatchPromise` in case there is a sync error

Open schickling opened this issue 3 years ago • 1 comments

TODO: Better description

T.tryCatchPromise(
	() => {
		throw new Error('nooo')
	},
	(err) => {
		console.log('err', err) // Never gets called
		return err
	},
)

T.tryCatchPromise(
	async () => {
		throw new Error('nooo')
	},
	(err) => {
		console.log('err', err) // Works
		return err
	},
)

schickling avatar Aug 15 '22 15:08 schickling

Solved in main for next, need to backport

mikearnaldi avatar Aug 27 '22 18:08 mikearnaldi