MCPcopy
hub / github.com/github/docs / executeWithFallback

Function executeWithFallback

lib/render-with-fallback.js:59–69  ·  view source on GitHub ↗
(context, callable, fallback)

Source from the content-addressed store, hash-verified

57// )
58//
59export async function executeWithFallback(context, callable, fallback) {
60 try {
61 return await callable(context)
62 } catch (error) {
63 if (isLiquidError(error) && context.currentLanguage !== 'en') {
64 const enContext = Object.assign({}, context, { currentLanguage: 'en' })
65 return await fallback(enContext)
66 }
67 throw error
68 }
69}

Callers 3

ghesReleaseNotesContextFunction · 0.90
processLearningTracksFunction · 0.90

Calls 1

isLiquidErrorFunction · 0.85

Tested by

no test coverage detected