"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 })); })); }; };