Skip to content

Commit 481772c

Browse files
authored
Merge pull request #69 from sushobhit-lt/DOT-1974
fix error handling
2 parents 3c9c92e + d432675 commit 481772c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

commands/utils/validate.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,18 @@ function validateConfigBrowsers(browsers) {
161161

162162
function validateConfigResolutions(resolutions) {
163163
if (!Array.isArray(resolutions)) {
164-
throw new ValidationError('invalid resolutions.');
164+
throw new ValidationError('Invalid viewports config. Please add atleast one viewport.');
165165
}
166166
if (resolutions.length == 0) {
167-
throw new ValidationError('empty resolutions list in config.');
167+
throw new ValidationError('Empty viewports list in config.');
168168
}
169169
if (resolutions.length > 5) {
170170
throw new ValidationError(`max resolutions: ${MAX_RESOLUTIONS}`);
171171
}
172172
let res = [];
173173
resolutions.forEach(element => {
174174
if (!Array.isArray(element) || element.length == 0 || element.length > 2) {
175-
throw new ValidationError('invalid resolutions.');
175+
throw new ValidationError('Invalid elements in viewports config.');
176176
}
177177
let width = element[0];
178178
let height = element[1];

0 commit comments

Comments
 (0)