1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-27 23:28:38 +02:00

Desktop: Turn old plugin deprecation notices into errors

This commit is contained in:
Laurent Cozic
2021-08-05 12:02:03 +01:00
parent 8471be16aa
commit 7f00e4ea5b
9 changed files with 32 additions and 14 deletions

View File

@ -143,8 +143,12 @@ export default class Plugin {
return this.viewControllers_[handle];
}
public deprecationNotice(goneInVersion: string, message: string) {
logger.warn(`"${this.id}": DEPRECATION NOTICE: ${message} This will stop working in version ${goneInVersion}.`);
public deprecationNotice(goneInVersion: string, message: string, isError: boolean = false) {
if (isError) {
throw new Error(`"${this.id}": No longer supported: ${message} (deprecated since version ${goneInVersion})`);
} else {
logger.warn(`"${this.id}": DEPRECATION NOTICE: ${message} This will stop working in version ${goneInVersion}.`);
}
}
public emitMessage(message: any) {