Prevent uninstall error on install error
This commit is contained in:
parent
1281e6a5f7
commit
f86ff3a026
|
@ -370,6 +370,7 @@ export class PluginManager implements ServerHook {
|
||||||
} catch (rootErr) {
|
} catch (rootErr) {
|
||||||
logger.error('Cannot install plugin %s, removing it...', toInstall, { err: rootErr })
|
logger.error('Cannot install plugin %s, removing it...', toInstall, { err: rootErr })
|
||||||
|
|
||||||
|
if (npmName) {
|
||||||
try {
|
try {
|
||||||
await this.uninstall({ npmName })
|
await this.uninstall({ npmName })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -381,6 +382,7 @@ export class PluginManager implements ServerHook {
|
||||||
logger.error('Cannot remove plugin %s after failed installation.', toInstall, { err })
|
logger.error('Cannot remove plugin %s after failed installation.', toInstall, { err })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
throw rootErr
|
throw rootErr
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue