Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More detailed error messages #252

Open
ghost opened this issue May 11, 2022 · 1 comment
Open

More detailed error messages #252

ghost opened this issue May 11, 2022 · 1 comment
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented May 11, 2022

See #242.

@ghost ghost added this to JAM May 11, 2022
@ghost ghost added this to the v0.0.6 - Cooking Timer milestone May 11, 2022
@ghost ghost moved this to Todo 📝 in JAM May 18, 2022
@ghost ghost removed this from the v0.0.6 - Cooking Timer milestone May 18, 2022
@ghost ghost removed the scheduled transactions label May 18, 2022
@theborakompanioni theborakompanioni changed the title More detailed error messages on Jam screen More detailed error messages Oct 31, 2022
@theborakompanioni
Copy link
Collaborator

theborakompanioni commented Oct 31, 2022

Assigned myself to this.

Currently, whenever an error is returned by the api, something like this is done:

await Api.getWalletUtxos(requestContext)
      .then((res) =>
        res.ok ? res.json() : Api.Helper.throwError(res, t('global.errors.error_reloading_wallet_failed'))
      )
[...]

However, the second param to throwError is just a "fallback reason". When JM provides a reason, it sometimes is just a generic phrase like Processing failed. Hence, an improvement would be, if the returned reason was wrapped with a more specific error, which should be known because of the context in was called in. Here, it might be something like Error while reloading wallet. Reason: Processing failed.

e.g.

await Api.getWalletUtxos(requestContext)
      .then((res) =>
        res.ok ? res.json() : Api.Helper.throwWrapped(res, {
          message: t('global.errors.error_reloading_wallet_failed'),
          fallback: t('global.errors.reason_unknown')
        }))
      )
[...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo 📝
Development

No branches or pull requests

2 participants