Skip to content

Commit

Permalink
[Security Solution][Endpoint] Mark code for refactor (elastic#104278)
Browse files Browse the repository at this point in the history
* mark for refactor

refs elastic/security-team/issues/1407
refs elastic/pull/101961/files

* update comments

review change
  • Loading branch information
ashokaditya authored and madirey committed Jul 6, 2021
1 parent e6222da commit d44f179
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ describe('endpoint list middleware', () => {
});
});

describe('handle Endpoint Pending Actions state actions', () => {
describe.skip('handle Endpoint Pending Actions state actions', () => {
let mockedApis: ReturnType<typeof endpointPageHttpMock>;

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ export const endpointMiddlewareFactory: ImmutableMiddlewareFactory<EndpointState
});
}
} catch (error) {
// TODO should handle the error instead of logging it to the browser
// Also this is an anti-pattern we shouldn't use
// Ignore Errors, since this should not hinder the user's ability to use the UI
logError(error);
}
Expand Down Expand Up @@ -286,6 +288,8 @@ export const endpointMiddlewareFactory: ImmutableMiddlewareFactory<EndpointState
});
}
} catch (error) {
// TODO should handle the error instead of logging it to the browser
// Also this is an anti-pattern we shouldn't use
// Ignore Errors, since this should not hinder the user's ability to use the UI
logError(error);
}
Expand Down Expand Up @@ -331,6 +335,8 @@ export const endpointMiddlewareFactory: ImmutableMiddlewareFactory<EndpointState
});
}
} catch (error) {
// TODO should handle the error instead of logging it to the browser
// Also this is an anti-pattern we shouldn't use
// Ignore Errors, since this should not hinder the user's ability to use the UI
logError(error);
}
Expand Down Expand Up @@ -537,6 +543,8 @@ const endpointsTotal = async (http: HttpStart): Promise<number> => {
})
).total;
} catch (error) {
// TODO should handle the error instead of logging it to the browser
// Also this is an anti-pattern we shouldn't use
logError(`error while trying to check for total endpoints`);
logError(error);
}
Expand All @@ -547,6 +555,8 @@ const doEndpointsExist = async (http: HttpStart): Promise<boolean> => {
try {
return (await endpointsTotal(http)) > 0;
} catch (error) {
// TODO should handle the error instead of logging it to the browser
// Also this is an anti-pattern we shouldn't use
logError(`error while trying to check if endpoints exist`);
logError(error);
}
Expand Down Expand Up @@ -613,6 +623,8 @@ async function getEndpointPackageInfo(
payload: createLoadedResourceState(packageInfo),
});
} catch (error) {
// TODO should handle the error instead of logging it to the browser
// Also this is an anti-pattern we shouldn't use
// Ignore Errors, since this should not hinder the user's ability to use the UI
logError(error);
dispatch({
Expand Down Expand Up @@ -663,6 +675,8 @@ const loadEndpointsPendingActions = async ({
payload: createLoadedResourceState(agentIdToPendingActions),
});
} catch (error) {
// TODO should handle the error instead of logging it to the browser
// Also this is an anti-pattern we shouldn't use
logError(error);
}
};

0 comments on commit d44f179

Please sign in to comment.