Skip to content

Commit 8ea11f6

Browse files
committed
gen-changelog: Fix error handling and improve error messages
1 parent 8ddef33 commit 8ea11f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

resources/gen-changelog.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,17 @@ function genChangeLog(tag, date, allPRs) {
8888
.filter(label => label.startsWith('PR: '));
8989

9090
if (labels.length === 0) {
91-
throw new Error(`PR #${pr.number} missing label`);
91+
throw new Error(`PR is missing label. See ${pr.url}`);
9292
}
9393
if (labels.length > 1) {
9494
throw new Error(
95-
`PR #${pr.number} has conflicting labels: ` + labels.join('\n'),
95+
`PR has conflicting labels: ${labels.join('\n')}\nSee ${pr.url}`,
9696
);
9797
}
9898

9999
const label = labels[0];
100100
if (!labelsConfig[label]) {
101-
throw new Error('Unknown label: ' + label + pr.number);
101+
throw new Error(`Unknown label: ${label}. See ${pr.url}`);
102102
}
103103
byLabel[label] = byLabel[label] || [];
104104
byLabel[label].push(pr);
@@ -185,7 +185,7 @@ function graphqlRequestImpl(query, variables, cb) {
185185
});
186186
});
187187

188-
req.on('error', error => cb(error));
188+
req.on('error', error => resultCB(error));
189189
req.write(JSON.stringify({ query, variables }));
190190
req.end();
191191
}

0 commit comments

Comments
 (0)