You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cvm/src/packages/exec-lvm/modifiers/handle-device-not-found.js

17 lines
484 B
JavaScript

"use strict";
const { errorResult } = require("../../text-parser");
const createRegexParser = require("../../text-parser-regex");
const errors = require("../errors");
module.exports = function (devicePath) {
return function handleDeviceNotFound(command) {
return command.expectOnStderr(createRegexParser(/Device .+ not found\./, () => {
return errorResult(new errors.InvalidPath(`Specified device '${devicePath}' does not exist`, {
path: devicePath
}));
}));
};
};