Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.

Commit 65a6916

Browse files
authored
Merge pull request #262 from netlify/chore/improve-error-message
feat: improve error message
2 parents 7951a16 + 7b3042e commit 65a6916

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/line_parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const parseParts = function (from, parts) {
9696

9797
const toIndex = parts.findIndex(isToPart)
9898
if (toIndex === -1) {
99-
throw new Error('Missing destination path/URL')
99+
throw new Error('The destination path/URL must start with "/", "http:" or "https:"')
100100
}
101101

102102
const queryParts = parts.slice(0, toIndex)

tests/line_parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ each(
162162
{ title: 'invalid_dot_netlify_path', errorMessage: /must not start/ },
163163
{ title: 'invalid_no_to_no_status', errorMessage: /Missing destination/ },
164164
{ title: 'invalid_no_to_status', errorMessage: /Missing "to" field/ },
165-
{ title: 'invalid_no_to_query', errorMessage: /Missing destination/ },
166-
{ title: 'invalid_no_slash', errorMessage: /Missing destination/ },
165+
{ title: 'invalid_no_to_query', errorMessage: /must start with/ },
166+
{ title: 'invalid_no_slash', errorMessage: /must start with/ },
167167
{ title: 'invalid_mistaken_headers', errorMessage: /Missing destination/ },
168168
],
169169
({ title }, { fixtureName = title, errorMessage }) => {

0 commit comments

Comments
 (0)