add sdk version in error report
This commit is contained in:
parent
a3c1f3a1ee
commit
77c9594d5c
1 changed files with 13 additions and 10 deletions
|
@ -5,6 +5,7 @@ import Yrbl from 'component/yrbl';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import { withRouter } from 'react-router';
|
import { withRouter } from 'react-router';
|
||||||
import Native from 'native';
|
import Native from 'native';
|
||||||
|
import { Lbry } from 'lbry-redux';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
children: React.Node,
|
children: React.Node,
|
||||||
|
@ -30,29 +31,31 @@ class ErrorBoundary extends React.Component<Props, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidCatch(error: { stack: string }) {
|
componentDidCatch(error: { stack: string }) {
|
||||||
let errorMessage = '\n';
|
let errorMessage = 'Uncaught error\n';
|
||||||
|
|
||||||
// @if TARGET='web'
|
// @if TARGET='web'
|
||||||
errorMessage += 'lbry.tv error\n';
|
errorMessage += 'lbry.tv\n';
|
||||||
errorMessage += window.location.pathname + window.location.search;
|
errorMessage += window.location.pathname + window.location.search;
|
||||||
this.log(errorMessage);
|
this.log(errorMessage);
|
||||||
// @endif
|
// @endif
|
||||||
// @if TARGET='app'
|
// @if TARGET='app'
|
||||||
Native.getAppVersionInfo().then(({ localVersion }) => {
|
Native.getAppVersionInfo().then(({ localVersion }) => {
|
||||||
errorMessage += `version: ${localVersion}\n`;
|
Lbry.version().then(({ lbrynet_version: sdkVersion }) => {
|
||||||
errorMessage += `page: ${window.location.href.split('.html')[1]}\n`;
|
errorMessage += `app version: ${localVersion}\n`;
|
||||||
errorMessage += `${error.stack}`;
|
errorMessage += `sdk version: ${sdkVersion}\n`;
|
||||||
|
errorMessage += `page: ${window.location.href.split('.html')[1]}\n`;
|
||||||
this.log(errorMessage);
|
errorMessage += `${error.stack}`;
|
||||||
|
this.log(errorMessage);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
// @endif
|
// @endif
|
||||||
}
|
}
|
||||||
|
|
||||||
log(message) {
|
log(message) {
|
||||||
declare var app: { env: string };
|
declare var app: { env: string };
|
||||||
if (app.env === 'production') {
|
// if (app.env === 'production') {
|
||||||
Lbryio.call('event', 'desktop_error', { error_message: message });
|
Lbryio.call('event', 'desktop_error', { error_message: message });
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh() {
|
refresh() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue