Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If no configuration found, or adapter was not properly installed, check it. #2418

Merged
merged 5 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/adapter/src/lib/adapter/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11885,7 +11885,7 @@ export class AdapterClass extends EventEmitter {
// give it a chance to handle the error itself instead of restarting it
if (typeof this._options.error === 'function') {
try {
// if error handler in the adapter returned exactly true,
// if the error handler in the adapter returned exactly true,
// we expect the error to be handled and do nothing more
const wasHandled = this._options.error(err);
if (wasHandled === true) {
Expand Down Expand Up @@ -12178,8 +12178,11 @@ export class AdapterClass extends EventEmitter {
};

this.pluginHandler = new PluginHandler(pluginSettings);
this.pluginHandler.addPlugins(this.ioPack.common.plugins, [this.adapterDir, __dirname]); // first resolve from adapter directory, else from js-controller

try {
this.pluginHandler.addPlugins(this.ioPack.common.plugins, [this.adapterDir, __dirname]); // first resolve from adapter directory, else from js-controller
} catch (e) {
this._logger.error(`Could not add plugins: ${e.message}`);
}
// finally init
_initDBs();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/lib/common/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ export async function sendDiagInfo(obj: Record<string, any>): Promise<void> {
*/
export function getAdapterDir(adapter: string): string | null {
// snip off 'iobroker.'
if (adapter.toLowerCase().startsWith(appName.toLowerCase() + '.')) {
if (adapter.toLowerCase().startsWith(`${appNameLowerCase}.`)) {
adapter = adapter.substring(appName.length + 1);
}
// snip off instance id
Expand Down
Loading