Skip to content

Commit b9e35ff

Browse files
authored
Merge pull request #11 from djmitche/error-on-no-rootUrl
give a nicer error message in the common case of undefined rootUrl
2 parents fa4efab + 043b2e9 commit b9e35ff

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const assert = require('assert');
2+
13
const TASKCLUSTER_NET = 'https://taskcluster.net';
24

35
const cleanRoot = rootUrl => rootUrl.replace(/\/$/, '');
@@ -52,6 +54,7 @@ class LegacyUrls {
5254

5355
class Urls {
5456
constructor(rootUrl) {
57+
assert(rootUrl, 'no rootUrl provided');
5558
this.rootUrl = cleanRoot(rootUrl);
5659
}
5760

0 commit comments

Comments
 (0)