Skip to content

Commit

Permalink
fix: Let's be more specific about "not implemented" (#31237)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Crash-- authored and facebook-github-bot committed Mar 26, 2021
1 parent e27ca7f commit 452240b
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions Libraries/Blob/URL.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]() {
Expand Down Expand Up @@ -154,43 +154,43 @@ 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 {
return this.toString();
}

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 {
Expand All @@ -213,6 +213,6 @@ export class URL {
}

get username() {
throw new Error('not implemented');
throw new Error('URL.username is not implemented');
}
}

0 comments on commit 452240b

Please sign in to comment.