MCPcopy Index your code
hub / github.com/NUKnightLab/TimelineJS3 / handleConfigError

Function handleConfigError

src/js/core/ConfigFactory.js:315–325  ·  view source on GitHub ↗

* Helper function to handle errors when fetching timeline configuration. * Creates a minimal TimelineConfig with the appropriate error logged. * * @param {Error} error - The error that occurred * @param {function} callback - Callback to invoke with the error TimelineConfig

(error, callback)

Source from the content-addressed store, hash-verified

313 * @param {function} callback - Callback to invoke with the error TimelineConfig
314 */
315function handleConfigError(error, callback) {
316 const tc = new TimelineConfig();
317 if (error.name == 'NetworkError') {
318 tc.logError(new TLError("network_err"));
319 } else if (error.name == 'TLError') {
320 tc.logError(error);
321 } else {
322 tc.logError(new TLError("unknown_read_err", error.name || error));
323 }
324 callback(tc);
325}
326
327/**
328 * Helper function to create a TimelineConfig from JSON data.

Callers 1

makeConfigFunction · 0.85

Calls 1

logErrorMethod · 0.95

Tested by

no test coverage detected