feat(vmware-explorer): improve error handling (#6734)

This commit is contained in:
Florent BEAUCHAMP
2023-03-27 17:11:41 +02:00
committed by GitHub
parent 5ce6f1fe4d
commit e19c7b949d

View File

@@ -4,13 +4,15 @@ import VhdEsxiCowd from './VhdEsxiCowd.mjs'
export default async function openDeltaVmdkasVhd(esxi, datastore, path, parentVhd, opts) {
let vhd
if (path.endsWith('-sesparse.vmdk')) {
throw new Error(`sesparse Vmdk reading is not functionnal yet ${path}`)
throw new Error(
`sesparse VMDK reading is not functional yet ${path}. For now, this VM can only be migrated if it doesn't have any snapshots and if it is halted.`
)
// vhd = new VhdEsxiSeSparse(esxi, datastore, path, parentVhd, opts)
} else {
if (path.endsWith('-delta.vmdk')) {
vhd = new VhdEsxiCowd(esxi, datastore, path, parentVhd, opts)
} else {
throw new Error(`Vmdk ${path} does not seems to be a delta vmdk`)
throw new Error(`Vmdk ${path} does not seems to be a delta vmdk.`)
}
}
await vhd.readHeaderAndFooter()