Skip to content

Commit

Permalink
chore: Remove Rollbar usage (#204)
Browse files Browse the repository at this point in the history
* chore: Remove Rollbar usage

* feat: Log previously reported errors
  • Loading branch information
kevinszuchet committed Aug 29, 2023
1 parent bb39b1a commit c28860e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 217 deletions.
9 changes: 3 additions & 6 deletions electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { getAppTitle, getAppBasePath } from './helpers'
import { createWindow, hideWindowInTray, loadDecentralandWeb, onOpenUrl, showWindowAndHideTray } from './window'
import { LauncherConfig, LauncherPaths } from './types'
import { isTrustedCertificate } from './certificateChecker'
import { reportError, initializeRollbar } from './rollbar'
import fs = require('fs')

const defaultConfig: LauncherConfig = {
Expand All @@ -34,7 +33,6 @@ class MainApp {
}

// all uncaught exceptions are being sent automatically
initializeRollbar()

initializeCrashReport()

Expand Down Expand Up @@ -68,9 +66,8 @@ console.log('Config:', main.config)
console.log('OS:', osName)

if (getOSName() === null) {
reportError('OS not supported', () => {
exit(1)
})
console.error('OS not supported')
exit(1)
}

const launcherPaths: LauncherPaths = {
Expand Down Expand Up @@ -215,7 +212,7 @@ app
})
})
.catch(async (error) => {
reportError(error)
console.error(`Error starting app: ${error}`)
})

function initializeCrashReport() {
Expand Down
33 changes: 0 additions & 33 deletions electron/rollbar.ts

This file was deleted.

6 changes: 2 additions & 4 deletions electron/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,9 @@ const reportFatalError = async (sender: WebContents, message: string) => {
const reportCrash = async (sender: WebContents, message: string) => {
const path = JSON.stringify({ playerlogpath: getPlayerLogPath() })
const data = JSON.stringify(`Player log:\n${getPlayerLog()}`)
const code = `window.Rollbar.error(${data}, ${path})`
console.log(`reportCrash path: ${path}`)

try {
await sender.executeJavaScript(code)

await reportFatalError(sender, `Renderer unexpected exit: ${message}`)
} catch (e) {
console.error(`Report crash, error: ${e}`)
Expand All @@ -166,7 +163,8 @@ const registerExecuteProcessEvent = (rendererPath: string, executablePath: strin

// We didn't find a way to get this windows store app package path dynamically
if (process.windowsStore) {
rendererPath = process.env.LOCALAPPDATA +
rendererPath =
process.env.LOCALAPPDATA +
`\\Packages\\DecentralandFoundation.Decentraland_4zmdhd0rz3xz8\\LocalCache\\Roaming\\explorer-desktop-launcher\\renderer\\`
}

Expand Down
Loading

0 comments on commit c28860e

Please sign in to comment.