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