MCPcopy Index your code
hub / github.com/tinyplex/tinybase / tryCatch

Function tryCatch

src/common/other.ts:161–173  ·  view source on GitHub ↗
(
  action: () => Return | Promise<Return>,
  then1?: (error: any) => void,
  then2?: (error: any) => void,
)

Source from the content-addressed store, hash-verified

159};
160
161export const tryCatch = async <Return>(
162 action: () => Return | Promise<Return>,
163 then1?: (error: any) => void,
164 then2?: (error: any) => void,
165): Promise<Return | void> => {
166 try {
167 return await action();
168 } catch (error) {
169 /*! istanbul ignore next */
170 then1?.(error);
171 then2?.(error);
172 }
173};

Callers 15

setTablesJsonFunction · 0.90
setValuesJsonFunction · 0.90
setJsonFunction · 0.90
index.tsFile · 0.90
storageListenerFunction · 0.90
index.tsFile · 0.90
forObjectStoresFunction · 0.90
runFunction · 0.90
loadFunction · 0.90
startAutoLoadFunction · 0.90
stopAutoLoadFunction · 0.90
saveFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…