mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2024-12-04 18:00:18 +00:00
Attempt to improve error logging
This commit is contained in:
parent
fd23160f81
commit
61964ccb1e
@ -12,7 +12,16 @@ function App() {
|
||||
setResult(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
if (err instanceof Error) {
|
||||
console.log({
|
||||
name: err.name,
|
||||
message: err.message,
|
||||
stack: err.stack,
|
||||
});
|
||||
} else {
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
setResult({ type: "failure", error: err.toString() });
|
||||
});
|
||||
};
|
||||
|
@ -110,5 +110,11 @@ btn.addEventListener("click", () => {
|
||||
inner.id = "res";
|
||||
inner.innerText = res;
|
||||
document.getElementById("res-placeholder").appendChild(inner);
|
||||
}).catch(console.log);
|
||||
}).catch(err => {
|
||||
if (err instanceof Error) {
|
||||
console.log({ name: err.name, message: err.message, stack: err.stack });
|
||||
return;
|
||||
}
|
||||
console.log(err);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user