MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / isPermissionError

Function isPermissionError

daemon/src/service/network_limit_service.ts:28–37  ·  view source on GitHub ↗
(err: any)

Source from the content-addressed store, hash-verified

26}
27
28function isPermissionError(err: any): boolean {
29 const errorText = getErrorText(err);
30 return (
31 err?.code === "EACCES" ||
32 err?.code === "EPERM" ||
33 errorText.includes("Operation not permitted") ||
34 errorText.includes("Permission denied") ||
35 errorText.includes("RTNETLINK answers: Operation not permitted")
36 );
37}
38
39function formatCommand(command: string, args: string[] = []): string {
40 return [command, ...args].join(" ");

Callers 1

execWithSudoFunction · 0.85

Calls 1

getErrorTextFunction · 0.85

Tested by

no test coverage detected