From 452240bafa970578144aedaea0223e17863d2d26 Mon Sep 17 00:00:00 2001 From: Quentin Valmori Date: Fri, 26 Mar 2021 15:58:45 -0700 Subject: [PATCH] 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 --- Libraries/Blob/URL.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Libraries/Blob/URL.js b/Libraries/Blob/URL.js index bced25e695a..0b0e9be74d1 100644 --- a/Libraries/Blob/URL.js +++ b/Libraries/Blob/URL.js @@ -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'); } }