----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/63436/ -----------------------------------------------------------
(Updated Oct. 31, 2017, 8:15 p.m.) Review request for Aurora, David McLaughlin, Joshua Cohen, and Kai Huang. Repository: aurora Description ------- # Enabling ErrorBoundary in Scheduler UI React 16 introduces a new concept of an “error boundary” that allows us to limit the impact of an error and not unmount the whole component tree. I am open to keeping or removing the stack trace. from React docs: > As of React 16, errors that were not caught by any error boundary will result > in unmounting of the whole React component tree. Diffs (updated) ----- ui/.eslintrc 5cdc4e67030a79c3f81c06f585cc9ff5ce959e52 ui/src/main/js/components/ErrorBoundary.js PRE-CREATION ui/src/main/js/components/__tests__/ErrorBoundary-test.js PRE-CREATION ui/src/main/js/index.js 9f94d4bd6f649d74bdd9c3aa99783e01cae25d93 Diff: https://reviews.apache.org/r/63436/diff/2/ Changes: https://reviews.apache.org/r/63436/diff/1-2/ Testing (updated) ------- - Unit tests added. ``` # rmotamedi@tw-mbp-rmotamedi:~/oss/aurora on git:error-boundry-test ? [13:06:52] ? ./gradlew ui:test BUILD SUCCESSFUL in 0s 2 actionable tasks: 2 up-to-date # rmotamedi@tw-mbp-rmotamedi:~/oss/aurora on git:error-boundry-test ? [13:07:46] ? ./gradlew ui:lint BUILD SUCCESSFUL in 5s 4 actionable tasks: 4 up-to-date ``` - For more testing, I added the following component (that raises an error) and installed it under different components. I attached the screen-shots of how this will render. Clicking the link initializes the process of Jira ticket creation. ## ComponentWithError ``` import React from 'react' export default class ComponentWithError extends React.Component { render() { throw new Error('Crashed!'); return <div />; } } ``` File Attachments (updated) ---------------- Apache Jira ticket template filled with information on the bug https://reviews.apache.org/media/uploaded/files/2017/10/31/0b50175f-0dd5-44fe-8bc4-c69ca1723729__Screen_Shot_2017-10-31_at_11.55.39_AM.png Catching exceptions on the router https://reviews.apache.org/media/uploaded/files/2017/10/31/915182ef-4229-4b22-b7c6-20a5f24f8e1a__Screen_Shot_2017-10-31_at_11.44.56_AM.png Thanks, Reza Motamedi