Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bfd370ca5b |
@@ -31,12 +31,11 @@
|
|||||||
// an error instead of accepting the refusal.
|
// an error instead of accepting the refusal.
|
||||||
//
|
//
|
||||||
// Whatever code arrived is passed through verbatim rather than being
|
// Whatever code arrived is passed through verbatim rather than being
|
||||||
// matched against a list: the extension emits codes such as 4001, 4100,
|
// matched against a list: the extension emits 4001, 4100, 4200 and 4902,
|
||||||
// 4200 and 4902, and a code this file has never heard of is still the
|
// and a code this file has never heard of is still the truth about what
|
||||||
// truth about what happened. An error reported with no code at all stays
|
// happened. An error reported with no code at all stays a plain Error —
|
||||||
// a plain Error — a ProviderRpcError whose `code` is undefined would
|
// a ProviderRpcError whose `code` is undefined would advertise a
|
||||||
// advertise a conformance it does not have. `message` is untouched in
|
// conformance it does not have. `message` is untouched in every case.
|
||||||
// every case.
|
|
||||||
function toPageError(error) {
|
function toPageError(error) {
|
||||||
const message = (error && error.message) || "Request failed";
|
const message = (error && error.message) || "Request failed";
|
||||||
if (error && error.code !== undefined && error.code !== null) {
|
if (error && error.code !== undefined && error.code !== null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user