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
3c6f0d9767
commit
367482c540
|
@ -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