Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support newlines in EuiErrorBoundary. #238

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# [`master`](https://github.com/elastic/eui/tree/master)

- Updated `euiPopover` to propogate `panelPaddingSize` padding values to content only (title does inherit horizontal values) via CSS. [(#229)](https://github.com/elastic/eui/pull/229)
- Updated `euiPopover` to propagate `panelPaddingSize` padding values to content only (title does inherit horizontal values) via CSS. [(#229)](https://github.com/elastic/eui/pull/229)
- Updated `<EuiErrorBoundary>` to preserve newlines in error. [(#238)[https://github.com/elastic/eui/pull/238]]

**Bug fixes**

Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/error_boundary/error_boundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '../../../../src/components';

const BadComponent = () => {
throw new Error('There was a terrible error!');
throw new Error('I\'m here to kick butt and chew bubblegum.\n\n\And I\'m all out of gum.');
};

export default () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ exports[`EuiErrorBoundary is rendered with an error 1`] = `
<h1>
Error
</h1>
<p>
Error: Terrible error!
</p>
<pre>
<p>
Error: I'm here to kick butt and chew bubblegum.

And I'm all out of gum.
</p>
</pre>
</div>
</div>
</div>
Expand Down
8 changes: 5 additions & 3 deletions src/components/error_boundary/error_boundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ export class EuiErrorBoundary extends Component {
<div className="euiErrorBoundary__text">
<EuiText size="xs">
<h1>Error</h1>
<p>
{this.state.error && this.state.error.toString()}
</p>
<pre>
<p>
{this.state.error && this.state.error.toString()}
</p>
</pre>
</EuiText>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/error_boundary/error_boundary.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const GoodComponent = () => (
);

const BadComponent = () => {
throw new Error('Terrible error!');
throw new Error('I\'m here to kick butt and chew bubblegum.\n\n\And I\'m all out of gum.');
};

describe('EuiErrorBoundary', () => {
Expand Down