Skip to content

Commit 452240b

Browse files
Crash--facebook-github-bot
authored andcommitted
fix: Let's be more specific about "not implemented" (#31237)
Summary: After installed a third party library I just got "Error: not implemented" without any other informations in the stack trace. Adding a more specific sentence within the error's message can be useful to understand what is going on. ## Changelog [General] [CHANGED] - Added context to URL's error messages when the feature is not implemented Pull Request resolved: #31237 Differential Revision: D27367109 Pulled By: PeteTheHeat fbshipit-source-id: 87e8b3beef661e028d89098729bd242a57bb9a47
1 parent e27ca7f commit 452240b

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

Libraries/Blob/URL.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -65,27 +65,27 @@ export class URLSearchParams {
6565
}
6666

6767
delete(name) {
68-
throw new Error('not implemented');
68+
throw new Error('URLSearchParams.delete is not implemented');
6969
}
7070

7171
get(name) {
72-
throw new Error('not implemented');
72+
throw new Error('URLSearchParams.get is not implemented');
7373
}
7474

7575
getAll(name) {
76-
throw new Error('not implemented');
76+
throw new Error('URLSearchParams.getAll is not implemented');
7777
}
7878

7979
has(name) {
80-
throw new Error('not implemented');
80+
throw new Error('URLSearchParams.has is not implemented');
8181
}
8282

8383
set(name, value) {
84-
throw new Error('not implemented');
84+
throw new Error('URLSearchParams.set is not implemented');
8585
}
8686

8787
sort() {
88-
throw new Error('not implemented');
88+
throw new Error('URLSearchParams.sort is not implemented');
8989
}
9090

9191
[Symbol.iterator]() {
@@ -154,43 +154,43 @@ export class URL {
154154
}
155155

156156
get hash() {
157-
throw new Error('not implemented');
157+
throw new Error('URL.hash is not implemented');
158158
}
159159

160160
get host() {
161-
throw new Error('not implemented');
161+
throw new Error('URL.host is not implemented');
162162
}
163163

164164
get hostname() {
165-
throw new Error('not implemented');
165+
throw new Error('URL.hostname is not implemented');
166166
}
167167

168168
get href(): string {
169169
return this.toString();
170170
}
171171

172172
get origin() {
173-
throw new Error('not implemented');
173+
throw new Error('URL.origin is not implemented');
174174
}
175175

176176
get password() {
177-
throw new Error('not implemented');
177+
throw new Error('URL.password is not implemented');
178178
}
179179

180180
get pathname() {
181-
throw new Error('not implemented');
181+
throw new Error('URL.pathname not implemented');
182182
}
183183

184184
get port() {
185-
throw new Error('not implemented');
185+
throw new Error('URL.port is not implemented');
186186
}
187187

188188
get protocol() {
189-
throw new Error('not implemented');
189+
throw new Error('URL.protocol is not implemented');
190190
}
191191

192192
get search() {
193-
throw new Error('not implemented');
193+
throw new Error('URL.search is not implemented');
194194
}
195195

196196
get searchParams(): URLSearchParams {
@@ -213,6 +213,6 @@ export class URL {
213213
}
214214

215215
get username() {
216-
throw new Error('not implemented');
216+
throw new Error('URL.username is not implemented');
217217
}
218218
}

0 commit comments

Comments
 (0)