use of org.rstudio.studio.client.common.debugging.ui.ConsoleError in project rstudio by rstudio.
the class ShellWidget method consoleWriteExtendedError.
public void consoleWriteExtendedError(final String error, UnhandledError traceInfo, boolean expand, String command) {
if (errorNodes_.containsKey(error)) {
Node errorNode = errorNodes_.get(error);
clearPendingInput();
ConsoleError errorWidget = new ConsoleError(traceInfo, getErrorClass(), this, command);
if (expand)
errorWidget.setTracebackVisible(true);
errorNode.getParentNode().replaceChild(errorWidget.getElement(), errorNode);
scrollPanel_.onContentSizeChanged();
errorNodes_.remove(error);
}
}
use of org.rstudio.studio.client.common.debugging.ui.ConsoleError in project rstudio by rstudio.
the class ChunkOutputStream method showErrorOutput.
@Override
public void showErrorOutput(UnhandledError err) {
hasErrors_ = true;
// error UX
if (err.getErrorFrames() != null && err.getErrorFrames().length() < 2) {
flushQueuedErrors();
return;
}
int idx = queuedError_.indexOf(err.getErrorMessage());
if (idx >= 0) {
// emit any messages queued prior to the error
if (idx > 0) {
renderConsoleOutput(queuedError_.substring(0, idx), classOfOutput(ChunkConsolePage.CONSOLE_ERROR));
initializeOutput(RmdChunkOutputUnit.TYPE_ERROR);
}
// leave messages following the error in the queue
queuedError_ = queuedError_.substring(idx + err.getErrorMessage().length());
} else {
// flush any irrelevant messages from the stream
flushQueuedErrors();
}
UIPrefs prefs = RStudioGinjector.INSTANCE.getUIPrefs();
ConsoleError error = new ConsoleError(err, prefs.getThemeErrorClass(), this, null);
error.setTracebackVisible(prefs.autoExpandErrorTracebacks().getValue());
add(error);
flushQueuedErrors();
onHeightChanged();
}
Aggregations