Skip to content

Commit 4cb54df

Browse files
committed
Display an error message on edition mismatch
This change will show a warning when setting up a commercial edition but connecting to a raw one, or when setting a raw edition and connecting to a commercial one. In the last case the message warns about some unavailable functionality unless commercial editions is selected
1 parent 52a3861 commit 4cb54df

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/backend/rest.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,14 @@ export default class RestApiBackend implements Backend {
176176
`Checkmk version 2.1.0 has been detected, but this plugin is configured to use version 2.2.0 and above. Please set the backend option to '< 2.2'.`
177177
);
178178
}
179-
if (this.datasource.getEdition() === 'CEE' && result.data.edition === 'raw') {
179+
if (this.datasource.getEdition() !== 'RAW' && result.data.edition === 'cre') {
180180
throw new Error(
181-
'The data source specified the Checkmk Enterprise Edition, but Checkmk Raw Edition was detected. Please choose the raw edition in the data source settings.'
181+
'The data source specified the Checkmk commercial editions, but Checkmk Raw Edition was detected. Choose the raw edition in the data source settings.'
182+
);
183+
}
184+
if (this.datasource.getEdition() === 'RAW' && result.data.edition !== 'cre') {
185+
throw new Error(
186+
'The data source specified the Checkmk Raw Edition, but a Checkmk commercial edition was detected. Some functionality may not be available. Choose commercial editions in the data source settings to enable all features.'
182187
);
183188
}
184189
// The REST API would be ok with other users, but the autocompleter are not

0 commit comments

Comments
 (0)