UNPKG

@tendrock/lib

Version:

A lib under the Tendrock system for Minecraft Bedrock Script API

12 lines (11 loc) 261 B
export function tryCatch(func) { const result = { data: undefined, error: undefined, success: true }; try { result.data = func(); } catch (error) { result.error = error; result.success = false; } return result; }