Skip to content

Commit 1eaa2f3

Browse files
rhysfredrhys
andauthored
fix: Log error before renaming failed to load converters (#30436)
Co-authored-by: rhys <rhys@frontleftspeaker.com>
1 parent 3adf7d5 commit 1eaa2f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/extension/externalJS.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,14 @@ export default abstract class ExternalJSExtension<M> extends Extension {
202202
const mod = await this.importFile(filePath);
203203
await this.loadJS(extension.name, mod.default);
204204
} catch (error) {
205-
// change ext so Z2M doesn't try to load it again and again
206-
fs.renameSync(filePath, `${filePath}.invalid`);
207-
208205
logger.error(
209206
`Invalid external ${this.mqttTopic} '${extension.name}' was ignored and renamed to prevent interference with Zigbee2MQTT. (${(error as Error).message})`,
210207
);
211208
// biome-ignore lint/style/noNonNullAssertion: always Error
212209
logger.debug((error as Error).stack!);
210+
211+
// change ext so Z2M doesn't try to load it again and again
212+
fs.renameSync(filePath, `${filePath}.invalid`);
213213
}
214214
}
215215
}

0 commit comments

Comments
 (0)