repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(deps-dev): apply updates
[poolifier.git]
/
src
/
worker
/
abstract-worker.ts
diff --git
a/src/worker/abstract-worker.ts
b/src/worker/abstract-worker.ts
index 5b3c3a3f06596b00fad84e691875b438325bc600..cd8f2346365f20ca5fb9e029dd436113594f19ac 100644
(file)
--- a/
src/worker/abstract-worker.ts
+++ b/
src/worker/abstract-worker.ts
@@
-460,11
+460,11
@@
export abstract class AbstractWorker<
/**
* Handles an error and convert it to a string so it can be sent back to the main worker.
*
/**
* Handles an error and convert it to a string so it can be sent back to the main worker.
*
- * @param e - The error raised by the worker.
+ * @param e
rror
- The error raised by the worker.
* @returns The error message.
*/
* @returns The error message.
*/
- protected handleError (e: Error | string): string {
- return e
instanceof Error ? e.message : e
+ protected handleError (e
rror
: Error | string): string {
+ return e
rror instanceof Error ? error.message : error
}
/**
}
/**
@@
-516,12
+516,11
@@
export abstract class AbstractWorker<
workerId: this.id,
taskId
})
workerId: this.id,
taskId
})
- } catch (e) {
- const errorMessage = this.handleError(e as Error | string)
+ } catch (error) {
this.sendToMainWorker({
taskError: {
name: name as string,
this.sendToMainWorker({
taskError: {
name: name as string,
- message:
errorMessage
,
+ message:
this.handleError(error as Error | string)
,
data
},
workerId: this.id,
data
},
workerId: this.id,
@@
-555,12
+554,11
@@
export abstract class AbstractWorker<
})
return null
})
})
return null
})
- .catch(e => {
- const errorMessage = this.handleError(e as Error | string)
+ .catch(error => {
this.sendToMainWorker({
taskError: {
name: name as string,
this.sendToMainWorker({
taskError: {
name: name as string,
- message:
errorMessage
,
+ message:
this.handleError(error as Error | string)
,
data
},
workerId: this.id,
data
},
workerId: this.id,