Skip to content

Commit

Permalink
Fix: Error panel in dialog (#4106)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-mng authored Jul 23, 2024
1 parent 94af841 commit 871e248
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/web/components/error/errorpanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const ErrorDetails = styled.div`
overflow-x: auto;
`;

const StyledPre = styled.pre`
word-break: break-word;
`;

const ErrorPanel = ({error, message, info}) => {
const [showDetails, setShowDetails] = useState(false);

Expand Down Expand Up @@ -71,11 +75,13 @@ const ErrorPanel = ({error, message, info}) => {
{error.name}: {error.message}
</h3>
{isDefined(info) && (
<pre data-testid="errorpanel-component-stack">
<StyledPre data-testid="errorpanel-component-stack">
{info.componentStack}
</pre>
</StyledPre>
)}
<pre data-testid="errorpanel-error-stack">{error.stack}</pre>
<StyledPre data-testid="errorpanel-error-stack">
{error.stack}
</StyledPre>
</Divider>
</ErrorDetails>
)}
Expand Down

0 comments on commit 871e248

Please sign in to comment.