mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2024-12-04 18:00:18 +00:00
JSON stringify errors
This commit is contained in:
parent
61964ccb1e
commit
57f8a851eb
@ -13,13 +13,15 @@ function App() {
|
|||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
if (err instanceof Error) {
|
if (err instanceof Error) {
|
||||||
console.log({
|
console.log(
|
||||||
name: err.name,
|
JSON.stringify({
|
||||||
message: err.message,
|
name: err.name,
|
||||||
stack: err.stack,
|
message: err.message,
|
||||||
});
|
stack: err.stack,
|
||||||
|
}),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
console.log(err);
|
console.log(JSON.stringify(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
setResult({ type: "failure", error: err.toString() });
|
setResult({ type: "failure", error: err.toString() });
|
||||||
|
@ -112,9 +112,9 @@ btn.addEventListener("click", () => {
|
|||||||
document.getElementById("res-placeholder").appendChild(inner);
|
document.getElementById("res-placeholder").appendChild(inner);
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
if (err instanceof Error) {
|
if (err instanceof Error) {
|
||||||
console.log({ name: err.name, message: err.message, stack: err.stack });
|
console.log(JSON.stringify({ name: err.name, message: err.message, stack: err.stack }));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(err);
|
console.log(JSON.stringify(err));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user