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: https://github.com/facebook/react-native/pull/31237

Differential Revision: D27367109

Pulled By: PeteTheHeat

fbshipit-source-id: 87e8b3beef661e028d89098729bd242a57bb9a47
This commit is contained in:
Quentin Valmori
2021-03-26 16:00:33 -07:00
committed by Facebook GitHub Bot
parent e27ca7f24e
commit 452240bafa
+16 -16
View File
@@ -65,27 +65,27 @@ export class URLSearchParams {
}
delete(name) {
throw new Error('not implemented');
throw new Error('URLSearchParams.delete is not implemented');
}
get(name) {
throw new Error('not implemented');
throw new Error('URLSearchParams.get is not implemented');
}
getAll(name) {
throw new Error('not implemented');
throw new Error('URLSearchParams.getAll is not implemented');
}
has(name) {
throw new Error('not implemented');
throw new Error('URLSearchParams.has is not implemented');
}
set(name, value) {
throw new Error('not implemented');
throw new Error('URLSearchParams.set is not implemented');
}
sort() {
throw new Error('not implemented');
throw new Error('URLSearchParams.sort is not implemented');
}
[Symbol.iterator]() {
@@ -154,15 +154,15 @@ export class URL {
}
get hash() {
throw new Error('not implemented');
throw new Error('URL.hash is not implemented');
}
get host() {
throw new Error('not implemented');
throw new Error('URL.host is not implemented');
}
get hostname() {
throw new Error('not implemented');
throw new Error('URL.hostname is not implemented');
}
get href(): string {
@@ -170,27 +170,27 @@ export class URL {
}
get origin() {
throw new Error('not implemented');
throw new Error('URL.origin is not implemented');
}
get password() {
throw new Error('not implemented');
throw new Error('URL.password is not implemented');
}
get pathname() {
throw new Error('not implemented');
throw new Error('URL.pathname not implemented');
}
get port() {
throw new Error('not implemented');
throw new Error('URL.port is not implemented');
}
get protocol() {
throw new Error('not implemented');
throw new Error('URL.protocol is not implemented');
}
get search() {
throw new Error('not implemented');
throw new Error('URL.search is not implemented');
}
get searchParams(): URLSearchParams {
@@ -213,6 +213,6 @@ export class URL {
}
get username() {
throw new Error('not implemented');
throw new Error('URL.username is not implemented');
}
}