I use Javascript SDK to connect to Horizon. It works, but I also would like the specific error if it doesn't work. See my code below.
How can I access the specific code returned from horizon (e.g. 404)? Right now I only get "Error".
Thanks in advance.
// --- check if account is active
server.accounts()
.accountId(publicKey)
.call()
.then(function (accountResult)
...
})
.catch(function (err) {
alert(err);
document.getElementById("error").innerHTML = 'Account not valid or inactive1!';
})