see https see https param promise param errorExt export async function to < U = Error , T = any > ( promise , errorExt ? ) { return promise . then < [ null , T ] > ( ( data ) => [ null , data ] ) . catch < [ U , undefined ] > ( ( err ) => { if ( errorExt ) { Object . assign ( err , errorExt ) ; } return [ err , undefined ] ; } ) ; }