Skip to content

Commit 87d8d06

Browse files
committed
fixing error as strings
1 parent abfba75 commit 87d8d06

File tree

11 files changed

+12
-24
lines changed

11 files changed

+12
-24
lines changed

src/add-to-ipfs.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ module.exports = async function (files) {
130130
const res = await addFileOrDirectory(ipfsd.api, file)
131131
successes.push(res)
132132
} catch (e) {
133-
// @ts-ignore
134-
failures.push(e.toString())
133+
failures.push(String(e))
135134
}
136135
}))
137136

src/auto-launch.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ module.exports = async function () {
9191

9292
return true
9393
} catch (err) {
94-
// @ts-ignore
95-
logger.error(`[launch on startup] ${err.toString()}`)
94+
logger.error(`[launch on startup] ${String(err)}`)
9695

9796
if (feedback) {
9897
// @ts-ignore

src/auto-updater/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ function setup () {
5454
try {
5555
await autoUpdater.downloadUpdate()
5656
} catch (err) {
57-
// @ts-ignore
58-
logger.error(`[updater] ${err.toString()}`)
57+
logger.error(`[updater] ${String(err)}`)
5958
}
6059

6160
if (!feedback) {

src/automatic-gc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ module.exports = async function () {
4747

4848
return true
4949
} catch (err) {
50-
// @ts-ignore
51-
logger.error(`[automatic gc] ${err.toString()}`)
50+
logger.error(`[automatic gc] ${String(err)}`)
5251

5352
return false
5453
}

src/context.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ class Context {
6464
this._properties.set(propertyName, value)
6565
this._resolvePropToValue(propertyName, value)
6666
} catch (e) {
67-
// @ts-ignore
68-
logger.error(e)
67+
logger.error(String(e))
6968
}
7069
}
7170

@@ -109,8 +108,7 @@ class Context {
109108
return await originalFn(...args)
110109
} catch (err) {
111110
logger.error(`[ctx] Error calling ${String(propertyName)}`)
112-
// @ts-ignore
113-
logger.error(err)
111+
logger.error(String(err))
114112
throw err
115113
}
116114
}

src/daemon/config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,7 @@ function checkRepositoryAndConfiguration (ipfsd) {
469469
return true
470470
} catch (e) {
471471
// Save to error.log
472-
// @ts-ignore
473-
logger.error(e)
472+
logger.error(String(e))
474473
dialogs.repositoryIsInvalidDialog(ipfsd.path)
475474
return false
476475
}

src/daemon/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ async function setupDaemon () {
9494
log.end()
9595
updateStatus(STATUS.STOPPING_FINISHED)
9696
} catch (err) {
97-
// @ts-ignore
98-
logger.error(`[ipfsd] ${err.toString()}`)
97+
logger.error(`[ipfsd] ${String(err)}`)
9998
updateStatus(STATUS.STOPPING_FAILED)
10099
} finally {
101100
ipfsd = null

src/enable-namesys-pubsub.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ module.exports = async function () {
4343

4444
return true
4545
} catch (err) {
46-
// @ts-ignore
47-
logger.error(`[ipns over pubsub] ${err.toString()}`)
46+
logger.error(`[ipns over pubsub] ${String(err)}`)
4847

4948
return false
5049
}

src/enable-pubsub.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ module.exports = async function () {
4343

4444
return true
4545
} catch (err) {
46-
// @ts-ignore
47-
logger.error(`[pubsub] ${err.toString()}`)
46+
logger.error(`[pubsub] ${String(err)}`)
4847

4948
return false
5049
}

src/handleError.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ function handleError (err) {
1818
return
1919
}
2020

21-
// @ts-ignore
22-
logger.error(err)
21+
logger.error(String(err))
2322
// @ts-ignore
2423
criticalErrorDialog(err)
2524
}

0 commit comments

Comments
 (0)