specify the invalid bind name in error message

This commit is contained in:
Girish Ramakrishnan
2020-05-02 11:07:58 -07:00
parent a183ce13ee
commit 3357ca76fe

View File

@@ -336,7 +336,7 @@ function validateEnv(env) {
function validateBinds(binds) {
for (let name of Object.keys(binds)) {
// just have friendly characters under /media
if (!/^[-0-9a-zA-Z_@$=#.%+]+$/.test(name)) return new BoxError(BoxError.BAD_FIELD, 'Invalid bind name');
if (!/^[-0-9a-zA-Z_@$=#.%+]+$/.test(name)) return new BoxError(BoxError.BAD_FIELD, `Invalid bind name: ${name}`);
const bind = binds[name];