Skip to content

Commit fae06f7

Browse files
committed
🚢 v3.7.2
- Better exception when passing non-existent template to [`.render()`](https://github.com/VeliovGroup/flow-router/blob/master/doc s/api/render.md) method
1 parent 8ab9942 commit fae06f7

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

‎.versions‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ [email protected]
2727
2828
2929
30-
local-test:ostrio:[email protected].1
30+
local-test:ostrio:[email protected].2
3131
3232
3333
@@ -42,7 +42,7 @@ [email protected]
4242
4343
4444
45-
45+
4646
4747
4848

‎client/renderer.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class BlazeRenderer {
156156
if (!_layout) {
157157
this.old.materialized = true;
158158
this.isRendering = false;
159-
throw new Meteor.Error(404, 'No such layout: ' + layout);
159+
throw new Meteor.Error(404, 'No such layout template: ' + layout);
160160
}
161161

162162
const current = this.newState(layout, template);
@@ -166,6 +166,12 @@ class BlazeRenderer {
166166

167167
const forceReRender = this.router && this.router._current && this.router._current.route && this.router._current.route.conf && this.router._current.route.conf.forceReRender === true;
168168
if (template) {
169+
if (!_template) {
170+
this.old.materialized = true;
171+
this.isRendering = false;
172+
throw new Meteor.Error(404, 'No such template: ' + template);
173+
}
174+
169175
if (forceReRender || this.old.template.name !== template) {
170176
current.template.name = template;
171177
current.template.blaze = _template;

‎package.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package.describe({
22
name: 'ostrio:flow-router-extra',
33
summary: 'Carefully extended flow-router with waitOn and template context',
4-
version: '3.7.1',
4+
version: '3.7.2',
55
git: 'https://github.com/VeliovGroup/flow-router'
66
});
77

0 commit comments

Comments
 (0)