Skip to content

Commit

Permalink
surface layout render errors (#7713)
Browse files Browse the repository at this point in the history
  • Loading branch information
doronpr committed May 22, 2023
1 parent 73ee650 commit 01e6a45
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Mock/Components/LayoutComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ export const LayoutComponent = class extends Component<ComponentProps> {
return <View />;
}
componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
console.error(
`Error while trying to render layout ${this.props.layoutNode.nodeId} of type ${this.props.layoutNode.type}`,
error,
errorInfo
throw new Error(
`Error while trying to render layout ${this.props.layoutNode.nodeId} of type ${this.props.layoutNode.type}: ${error}\n${errorInfo?.componentStack}`
);
}
};

0 comments on commit 01e6a45

Please sign in to comment.