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.
18 lines
553 B
JavaScript
18 lines
553 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 handleDeviceTooSmall(command) {
|
|
return command
|
|
.expectOnStderr(createRegexParser(/Cannot use .+: device is too small \(pv_min_size\)/, () => {
|
|
return errorResult(new errors.DeviceTooSmall(`Specified device '${devicePath}' is too small to create a physical volume on`, {
|
|
path: devicePath
|
|
}));
|
|
}));
|
|
};
|
|
};
|