dec0dOS/zero-ui

dev: Add try/catch in zt-address.js

roxlu opened this issue · 1 comments

roxlu commented

When the api.get.status() call fails in zt-address.js you get a unhandled promise rejection error w/o a stacktrace.

Adding try/catch + log will give a bit more info:

const api = require("../utils/controller-api");

module.exports = async function () {
  try {
    const res = await api.get("status");
    return res.data.address;
  }
  catch (err) {
    console.error(err);
  }
};

Hello, @roxlu.
Thanks for your suggestion. Implemented in d7f2e15