1import { maxRetries } from "./config.mjs"; 2 3async function wrapSendEvent(props) { 4 return await new Promise((resolve, reject) => { 5 window.Yappli.sendTrackedEvent( 6 props.name, 7 props.value, 8 (result, message) => { 9 if (!result) { 10 reject(new Error(message)); 11 } else { 12 resolve(result); 13 } 14 } 15 ); 16 }); 17} 18 19export async function yappliSendEvent(props, attempts = 1) { 20 if (!props.name) { 21 throw new Error("missing event name"); 22 } 23 try { 24 return await wrapSendEvent(props); 25 } catch (err) { 26 console.error( 27 `Yappli.sendTrackedEvent: reason=${err.message}, attempts=${attempts}` 28 ); 29 if (attempts >= maxRetries) { 30 console.info(`Yappli.sendTrackedEvent: gives up retrying`); 31 return; 32 } 33 return await yappliSendEvent(props, attempts + 1); 34 } 35}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.