From 90ac5f55a2f3dadad877356e67bf3d72a26951cc Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Wed, 3 Mar 2021 03:16:06 -0800 Subject: [PATCH] Add version number to error message Summary: Minimal tweak to the soft crash error reporting: include the version number Reviewed By: passy Differential Revision: D26754416 fbshipit-source-id: d517d0bdb6bcf5c58b492c60b5bb8cc5f6b288f6 --- desktop/app/src/init.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desktop/app/src/init.tsx b/desktop/app/src/init.tsx index c67ec37e9..a7bd2fea4 100644 --- a/desktop/app/src/init.tsx +++ b/desktop/app/src/init.tsx @@ -49,6 +49,7 @@ import constants from './fb-stubs/constants'; import styled from '@emotion/styled'; import {CopyOutlined} from '@ant-design/icons'; import {clipboard} from 'electron/common'; +import {getVersionString} from './utils/versionString'; if (process.env.NODE_ENV === 'development' && os.platform() === 'darwin') { // By default Node.JS has its internal certificate storage and doesn't use @@ -73,7 +74,11 @@ class AppFrame extends React.Component< getError() { return this.state.error - ? `${this.state.error}\n\nComponent stack:\n${this.state.errorInfo?.componentStack}\n\nError stacktrace:\n${this.state.error?.stack}` + ? `${ + this.state.error + }\n\nFlipper version: ${getVersionString()}\n\nComponent stack:\n${ + this.state.errorInfo?.componentStack + }\n\nError stacktrace:\n${this.state.error?.stack}` : ''; }