Prevent uninstall error on install error

pull/5817/head
Chocobozzz 2023-05-17 16:19:30 +02:00
parent 1281e6a5f7
commit f86ff3a026
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 9 additions and 7 deletions

View File

@ -370,6 +370,7 @@ export class PluginManager implements ServerHook {
} catch (rootErr) {
logger.error('Cannot install plugin %s, removing it...', toInstall, { err: rootErr })
if (npmName) {
try {
await this.uninstall({ npmName })
} catch (err) {
@ -381,6 +382,7 @@ export class PluginManager implements ServerHook {
logger.error('Cannot remove plugin %s after failed installation.', toInstall, { err })
}
}
}
throw rootErr
}