Skip to content

Commit

Permalink
Throw when attempting to access the sub cases client
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-buttner committed Apr 7, 2021
1 parent 25384fc commit 382315a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x-pack/plugins/cases/server/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import Boom from '@hapi/boom';

import { CasesClientArgs } from './types';
import { CasesSubClient, createCasesSubClient } from './cases/client';
import { AttachmentsSubClient, createAttachmentsSubClient } from './attachments/client';
import { UserActionsSubClient, createUserActionsSubClient } from './user_actions/client';
import { CasesClientInternal, createCasesClientInternal } from './client_internal';
import { createSubCasesClient, SubCasesClient } from './sub_cases/client';
import { ENABLE_CASE_CONNECTOR } from '../../common/constants';

export class CasesClient {
private readonly _casesClientInternal: CasesClientInternal;
Expand Down Expand Up @@ -40,6 +42,9 @@ export class CasesClient {
}

public get subCases() {
if (!ENABLE_CASE_CONNECTOR) {
throw Boom.badRequest('The case connector feature is disabled');
}
return this._subCases;
}

Expand Down

0 comments on commit 382315a

Please sign in to comment.