fix(build): tighten TypeScript compiler settings and harden error message handling
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartvm',
|
||||
version: '1.1.0',
|
||||
version: '1.1.1',
|
||||
description: 'A TypeScript module wrapping Amazon Firecracker VMM for managing lightweight microVMs'
|
||||
}
|
||||
|
||||
@@ -155,8 +155,9 @@ export class MicroVM {
|
||||
if (err instanceof SmartVMError) {
|
||||
throw err;
|
||||
}
|
||||
const message = err instanceof Error ? err.message : String(err);
|
||||
throw new SmartVMError(
|
||||
`Failed to start VM ${this.id}: ${err.message}`,
|
||||
`Failed to start VM ${this.id}: ${message}`,
|
||||
'START_FAILED',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -133,8 +133,9 @@ export class NetworkManager {
|
||||
|
||||
this.bridgeCreated = true;
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : String(err);
|
||||
throw new SmartVMError(
|
||||
`Failed to set up network bridge: ${err.message}`,
|
||||
`Failed to set up network bridge: ${message}`,
|
||||
'BRIDGE_SETUP_FAILED',
|
||||
);
|
||||
}
|
||||
@@ -169,8 +170,9 @@ export class NetworkManager {
|
||||
this.activeTaps.set(tapName, tap);
|
||||
return tap;
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : String(err);
|
||||
throw new SmartVMError(
|
||||
`Failed to create TAP device ${tapName}: ${err.message}`,
|
||||
`Failed to create TAP device ${tapName}: ${message}`,
|
||||
'TAP_CREATE_FAILED',
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user