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