scope transpileOnServerWithErrorWindow. sclass #DaClass { S snippetID; JFastLogView_noWrap transpilationErrorBox; Runnable onSuccess; O onError; // voidfunc(S) or Runnable void go(bool medium) { infoBox("Transpiling " + snippetID); final Pair p = transpileOnBestServer(snippetID, medium ? "medium" : "quick"); awt { if (p.a) { infoBox("Transpiled OK!"); hideWindow(transpilationErrorBox); transpilationErrorBox = null; callFInNewThread(onSuccess); } else { infoBox("Transpilation error. " + p.b); bool first = transpilationErrorBox == null; transpilationErrorBox = maximizeFrame(scrollAllTheWayDown(showText_fast_noWrap(transpilationErrorBox, "Transpilation Error", p.b))); if (first) { setFrameIcon(#1101268, transpilationErrorBox); addButtonsToWindow(transpilationErrorBox, jbuttonWithDisable("Medium transpile", r { go(true) }) ); } callFInNewThread(onError, p.b); } } } } svoid transpileOnServerWithErrorWindow(S snippetID, bool medium, final Runnable onSuccess, O... _) { nu(DaClass, paramsPlus(_, +snippetID, +onSuccess)).go(medium); } end scope