Skip to content

Commit

Permalink
Support newlines in EuiErrorBoundary. (#238)
Browse files Browse the repository at this point in the history
* Support newlines in EuiErrorBoundary.
  • Loading branch information
cjcenizal authored Dec 21, 2017
1 parent ce53c77 commit 4922884
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
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

0 comments on commit 4922884

Please sign in to comment.