Skip to content

Commit 3fbd984

Browse files
committed
πŸ‘¨β€πŸ’» Use callback if template or layout not found in .render() method
- Old behavior: Throw exception
1 parent b6dd196 commit 3fbd984

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

β€Žclient/renderer.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ class BlazeRenderer {
156156
if (!_layout) {
157157
this.old.materialized = true;
158158
this.isRendering = false;
159-
throw new Meteor.Error(404, 'No such layout template: ' + layout);
159+
const error = new Meteor.Error(404, `No such layout template: ${layout}`);
160+
callback(error);
161+
throw error;
160162
}
161163

162164
const current = this.newState(layout, template);
@@ -169,7 +171,9 @@ class BlazeRenderer {
169171
if (!_template) {
170172
this.old.materialized = true;
171173
this.isRendering = false;
172-
throw new Meteor.Error(404, 'No such template: ' + template);
174+
const error = new Meteor.Error(404, `No such template: ${template}`);
175+
current.callback(error);
176+
throw error;
173177
}
174178

175179
if (forceReRender || this.old.template.name !== template) {

0 commit comments

Comments
Β (0)