Avoid useless casting at error handling
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 29 Aug 2021 14:46:22 +0000 (16:46 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 29 Aug 2021 14:46:22 +0000 (16:46 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/worker/abstract-worker.ts

index 8dcaa4c4d4d9e5553cb2398921d49ec33f2eed9f..e97c03473c2dc04da13d6507b40fc750ca72d8a8 100644 (file)
@@ -146,7 +146,7 @@ export abstract class AbstractWorker<
    * @returns Message of the error.
    */
   protected handleError (e: Error | string): string {
-    return (e as unknown) as string
+    return e.toString()
   }
 
   /**