Skip to content

Commit 19fe714

Browse files
authored
Fix display of stack traces within RStudio's viewer pane (#996)
1 parent 1f133f3 commit 19fe714

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

dash-renderer/src/components/error/FrontEnd/FrontEndError.css

+9
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,12 @@
114114
overflow: hidden;
115115
display: inline-block;
116116
}
117+
118+
.dash-be-error__str {
119+
background-color: #fdf3f4;
120+
min-width: 386px;
121+
max-width: 650px;
122+
overflow: auto;
123+
display: inline-block;
124+
white-space: pre-wrap;
125+
}

dash-renderer/src/components/error/FrontEnd/FrontEndError.react.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ function UnconnectedErrorContent({error, base}) {
108108
</div>
109109
)}
110110
{/* Backend Error */}
111-
{typeof error.html !== 'string' ? null : (
111+
{typeof error.html !== 'string' ? null : error.html.indexOf(
112+
'<!DOCTYPE HTML'
113+
) === 0 ? (
112114
<div className="dash-be-error__st">
113115
<div className="dash-backend-error">
114116
{/* Embed werkzeug debugger in an iframe to prevent
@@ -140,6 +142,10 @@ function UnconnectedErrorContent({error, base}) {
140142
/>
141143
</div>
142144
</div>
145+
) : (
146+
<div className="dash-be-error__str">
147+
<div className="dash-backend-error">{error.html}</div>
148+
</div>
143149
)}
144150
</div>
145151
);

0 commit comments

Comments
 (0)