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-incompatible-device.js

17 lines
574 B
JavaScript

"use strict";
const { errorResult } = require("../../text-parser");
const createRegexParser = require("../../text-parser-regex");
const errors = require("../errors");
module.exports = function (devicePath, action) {
return function handleIncompatibleDevice(command) {
return command.expectOnStderr(createRegexParser(/Device .+ excluded by a filter\./, () => {
return errorResult(new errors.IncompatibleDevice(`Specified device '${devicePath}' could not be ${action} because it is incompatible; perhaps it's too small?`, {
path: devicePath
}));
}));
};
};