diff --git a/lib/devicectl.ts b/lib/devicectl.ts index dd41593..7617f68 100644 --- a/lib/devicectl.ts +++ b/lib/devicectl.ts @@ -103,7 +103,9 @@ export class Devicectl { return result as ExecuteResult; } catch (e: any) { - throw new Error(`'${cmdStr}' failed. Original error: ${e.stderr || e.stdout || e.message}`); + throw new Error(`'${cmdStr}' failed. Original error: ${e.stderr || e.stdout || e.message}`, { + cause: e, + }); } } diff --git a/lib/types.ts b/lib/types.ts index 9fd7178..b5c52ba 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -1,4 +1,4 @@ -import {SubProcess, TeenProcessExecResult} from 'teen_process'; +import type {SubProcess, TeenProcessExecResult} from 'teen_process'; /** * Information about a running process on the device diff --git a/tsconfig.json b/tsconfig.json index bea76f8..7f46171 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,8 @@ "outDir": "build", "checkJs": true, "esModuleInterop": true, - "types": ["node", "mocha"] + "types": ["node", "mocha"], + "strict": true }, "ts-node": { "transpileOnly": true,