Skip to content

Commit

Permalink
fix: update form hook onCreate error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
harshpatel-crest committed May 25, 2021
1 parent 9b36bea commit 4a66418
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/src/main/webapp/components/BaseFormView.jsx
Expand Up @@ -341,8 +341,12 @@ class BaseFormView extends PureComponent {
if (this.hookDeferred) {
this.hookDeferred.then(() => {
if (typeof this.hook.onCreate === 'function') {
// TODO: try catch to stop UI break
this.hook.onCreate();
try {
this.hook.onCreate();
} catch (err) {
// eslint-disable-next-line no-console
console.error(err);
}
}
});
}
Expand Down

0 comments on commit 4a66418

Please sign in to comment.