aurora-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reza Motamedi <>
Subject Review Request 63436: Enabling ErrorBoundary in Scheduler UI
Date Tue, 31 Oct 2017 01:58:15 GMT

This is an automatically generated e-mail. To reply, visit:

Review request for Aurora, David McLaughlin, Joshua Cohen, and Kai Huang.

Repository: aurora


# 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.


  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 
  ui/src/main/sass/app.scss 8a10e1c5a501828c39ca7b9cf6b518a2d7a99d28 
  ui/src/main/sass/components/_error-boundary.scss PRE-CREATION 



- Unit tests added. This however causes an error message to be logged on stdout.

? ./gradlew ui:test
ASS src/main/js/pages/__tests__/Job-test.js
PASS src/main/js/components/__tests__/InstanceViz-test.js
PASS src/main/js/pages/__tests__/Update-test.js
PASS src/main/js/components/__tests__/InstanceHistoryItem-test.js
PASS src/main/js/components/__tests__/Pagination-test.js
PASS src/main/js/components/__tests__/ErrorBoundary-test.js
  ? Console

    console.error node_modules/react-dom/cjs/react-dom.development.js:8305
      The above error occurred in the <ComponentWithError> component:
          in ComponentWithError
          in ErrorBoundary (created by WrapperComponent)
          in WrapperComponent

      React will try to recreate this component tree from scratch using the error boundary
you provided, ErrorBoundary.

2 actionable tasks: 2 up-to-date

# rmotamedi@tw-mbp-rmotamedi:~/oss/aurora on git:error-boundry ? [18:52:22]
? ./gradlew ui:lint

4 actionable tasks: 4 up-to-date

- For more testing, I added the following component (that raises an error) and installed it
under `UpdateInstanceEvents`. I then caught the error at various depths in the doom tree.
I attached the screen-shots of how this will render.

## ComponentWithError

import React from 'react'

export default class ComponentWithError extends React.Component {
  render() {
    throw new Error('Crashed!');
    return <div />;

File Attachments

handling boundary on the main router
handling boundary on a component deep in the doom tree.


Reza Motamedi

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message