Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6324e6c22d |
@@ -31,11 +31,12 @@
|
|||||||
// 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 4001, 4100, 4200 and 4902,
|
// matched against a list: the extension emits codes such as 4001, 4100,
|
||||||
// and a code this file has never heard of is still the truth about what
|
// 4200 and 4902, and a code this file has never heard of is still the
|
||||||
// happened. An error reported with no code at all stays a plain Error —
|
// truth about what happened. An error reported with no code at all stays
|
||||||
// a ProviderRpcError whose `code` is undefined would advertise a
|
// a plain Error — a ProviderRpcError whose `code` is undefined would
|
||||||
// conformance it does not have. `message` is untouched in every case.
|
// advertise a conformance it does not have. `message` is untouched in
|
||||||
|
// 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