How to use the errlop.default function in errlop

To help you get started, we’ve selected a few errlop examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bevry / boundation / source / answers.js View on Github external
}
				return !reason
			}
		})

		// get answers
		const answers = await inquirer.prompt(questions)

		// merge in defaults
		const values = Object.assign({}, defaults, answers)

		// return merge
		return values
	} catch (err) {
		return Promise.reject(
			new Errlop('Failed to fetch the answers from the user', err)
		)
	}
}
github bevry / boundation / source / extensions.js View on Github external
process.on('unhandledRejection', function unhandledRejection(error) {
	console.error(new Errlop('An unhandled promise failed', error))
	process.exit(-1)
})
github bevry / boundation / source / base.js View on Github external
/^# CUSTOM/i.test(line)
			)
			if (localCustomIndex !== -1) {
				const remoteLines = data.split('\n')
				const remoteCustomIndex = remoteLines.findIndex(line =>
					/^# CUSTOM/i.test(line)
				)
				data = remoteLines
					.slice(0, remoteCustomIndex)
					.concat(localLines.slice(localCustomIndex))
					.join('\n')
			}
		}
		return write(file, data)
	} catch (err) {
		return Promise.reject(new Errlop(`Download of ${opts.url} FAILED`, err))
	}
}
github bevry / boundation / source / get-node.js View on Github external
async function getNodeLTSVersions() {
	const url =
		'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json'
	try {
		const response = await fetch(url)
		const json = await response.json()
		const lts = Object.entries(json)
		return lts
	} catch (err) {
		throw new Errlop(`failed to fetch node.js LTS releases from ${url}`, err)
	}
}
async function getMinimumNodeLTSVersion() {
github bevry / boundation / source / fs.js View on Github external
safeps.exec(command, opts, function(err, stdout) {
			if (err) return reject(new Errlop(`exec failed: ${command}`, err))
			return resolve(stdout)
		})
	})

errlop

An extended Error class that envelops a parent error, such that the stack trace contains the causation

Artistic-2.0
Latest version published 4 months ago

Package Health Score

70 / 100
Full package analysis