mirror of https://github.com/status-im/consul.git
ui: Improves the 'you must provide ... to `generate`' error from href-to (#9514)
This originally comes form the ember-href-to helper and is one of those errors that when I see it I think ... hmmm This gives a little bit more of a clue as to what is wrong by logging the route name you asked for plus the params you passed to it so you: 1. Have more help finding the href-to that is problematic in the template/component 2. Can see all the parameters you passed (including a potential null parameter for the thing you are missing)
This commit is contained in:
parent
ee368e9a00
commit
41a4a9f4fb
|
@ -42,7 +42,14 @@ export default class HrefToHelper extends Helper {
|
|||
@service('router') router;
|
||||
|
||||
compute(params, hash) {
|
||||
return hrefTo(this, this.router, params, hash);
|
||||
let href;
|
||||
try {
|
||||
href = hrefTo(this, this.router, params, hash);
|
||||
} catch (e) {
|
||||
e.message = `${e.message} For "${params[0]}:${JSON.stringify(params.slice(1))}"`;
|
||||
throw e;
|
||||
}
|
||||
return href;
|
||||
}
|
||||
|
||||
@observes('router.currentURL')
|
||||
|
|
Loading…
Reference in New Issue