mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
- Added check to see if the program being referenced in the command field of the exec object in the User construct exists. If it doesn't an error will be raised. If more than 1 context is selected when adding a kubeconfig then valid contexts will be added and any with an error will not be. Signed-off-by: Steve Richards <srichards@mirantis.com> Co-authored-by: Steve Richards <srichards@mirantis.com>
12 lines
508 B
TypeScript
12 lines
508 B
TypeScript
export class ExecValidationNotFoundError extends Error {
|
|
constructor(execPath: string, isAbsolute: boolean) {
|
|
super(`User Exec command "${execPath}" not found on host.`);
|
|
let message = `User Exec command "${execPath}" not found on host.`;
|
|
if (!isAbsolute) {
|
|
message += ` Please ensure binary is found in PATH or use absolute path to binary in Kubeconfig`;
|
|
}
|
|
this.message = message;
|
|
this.name = this.constructor.name;
|
|
Error.captureStackTrace(this, this.constructor);
|
|
}
|
|
} |