Browse Source
Merge pull request #332 from Empact/enhance/lnd-error-handling
Make LND errors visible to users via a message box
renovate/lint-staged-8.x
Ben Woosley
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
12 additions and
3 deletions
-
app/main.dev.js
|
|
@ -10,7 +10,7 @@ |
|
|
|
* |
|
|
|
* |
|
|
|
*/ |
|
|
|
import { app, BrowserWindow, ipcMain } from 'electron' |
|
|
|
import { app, BrowserWindow, ipcMain, dialog } from 'electron' |
|
|
|
import path from 'path' |
|
|
|
import fs from 'fs' |
|
|
|
import { spawn } from 'child_process' |
|
|
@ -159,8 +159,17 @@ const startLnd = (alias, autopilot) => { |
|
|
|
] |
|
|
|
|
|
|
|
const neutrino = spawn(lndConfig.lndPath, neutrinoArgs) |
|
|
|
.on('error', error => console.log(`lnd error: ${error}`)) |
|
|
|
.on('close', code => console.log(`lnd shutting down ${code}`)) |
|
|
|
.on('error', (error) => { |
|
|
|
console.log(`lnd error: ${error}`) |
|
|
|
dialog.showMessageBox({ |
|
|
|
type: 'error', |
|
|
|
message: `lnd error: ${error}` |
|
|
|
}) |
|
|
|
}) |
|
|
|
.on('close', (code) => { |
|
|
|
console.log(`lnd shutting down ${code}`) |
|
|
|
app.quit() |
|
|
|
}) |
|
|
|
|
|
|
|
// Listen for when neutrino prints out data
|
|
|
|
neutrino.stdout.on('data', (data) => { |
|
|
|