mirror of
https://github.com/PR0M3TH3AN/VoxVera.git
synced 2025-09-09 07:28:43 +00:00
Add log path to OnionShare error
This commit is contained in:
@@ -72,7 +72,27 @@ function runServe(retry = false) {
|
|||||||
});
|
});
|
||||||
onionProc.on('close', code => {
|
onionProc.on('close', code => {
|
||||||
if ((code !== 0 && code !== null) || retry) {
|
if ((code !== 0 && code !== null) || retry) {
|
||||||
dialog.showErrorBox('OnionShare error', `onionshare exited with code ${code}.`);
|
let extra = '';
|
||||||
|
try {
|
||||||
|
const confRaw = fs.readFileSync(configPath, 'utf8');
|
||||||
|
const conf = JSON.parse(confRaw);
|
||||||
|
const logPath = path.join(
|
||||||
|
__dirname,
|
||||||
|
'..',
|
||||||
|
'..',
|
||||||
|
'host',
|
||||||
|
conf.subdomain,
|
||||||
|
'onionshare.log'
|
||||||
|
);
|
||||||
|
fs.readFileSync(logPath, 'utf8');
|
||||||
|
extra = `\nSee ${logPath} for details.`;
|
||||||
|
} catch (err) {
|
||||||
|
// ignore errors reading log
|
||||||
|
}
|
||||||
|
dialog.showErrorBox(
|
||||||
|
'OnionShare error',
|
||||||
|
`onionshare exited with code ${code}.${extra}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (!restarting && (code !== 0 || code === null)) {
|
if (!restarting && (code !== 0 || code === null)) {
|
||||||
restarting = true;
|
restarting = true;
|
||||||
|
Reference in New Issue
Block a user