From 77c9594d5c03398676de1f28095c8bc067f36abe Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 4 Jun 2019 15:00:33 -0400 Subject: [PATCH] add sdk version in error report --- src/ui/component/errorBoundary/view.jsx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/ui/component/errorBoundary/view.jsx b/src/ui/component/errorBoundary/view.jsx index 64d7ad10d..fb7132a8b 100644 --- a/src/ui/component/errorBoundary/view.jsx +++ b/src/ui/component/errorBoundary/view.jsx @@ -5,6 +5,7 @@ import Yrbl from 'component/yrbl'; import Button from 'component/button'; import { withRouter } from 'react-router'; import Native from 'native'; +import { Lbry } from 'lbry-redux'; type Props = { children: React.Node, @@ -30,29 +31,31 @@ class ErrorBoundary extends React.Component { } componentDidCatch(error: { stack: string }) { - let errorMessage = '\n'; + let errorMessage = 'Uncaught error\n'; // @if TARGET='web' - errorMessage += 'lbry.tv error\n'; + errorMessage += 'lbry.tv\n'; errorMessage += window.location.pathname + window.location.search; this.log(errorMessage); // @endif // @if TARGET='app' Native.getAppVersionInfo().then(({ localVersion }) => { - errorMessage += `version: ${localVersion}\n`; - errorMessage += `page: ${window.location.href.split('.html')[1]}\n`; - errorMessage += `${error.stack}`; - - this.log(errorMessage); + Lbry.version().then(({ lbrynet_version: sdkVersion }) => { + errorMessage += `app version: ${localVersion}\n`; + errorMessage += `sdk version: ${sdkVersion}\n`; + errorMessage += `page: ${window.location.href.split('.html')[1]}\n`; + errorMessage += `${error.stack}`; + this.log(errorMessage); + }); }); // @endif } log(message) { declare var app: { env: string }; - if (app.env === 'production') { - Lbryio.call('event', 'desktop_error', { error_message: message }); - } + // if (app.env === 'production') { + Lbryio.call('event', 'desktop_error', { error_message: message }); + // } } refresh() {