Skip to content

Commit

Permalink
Merge pull request #291 from jedd-ahyoung/viewport-friendly-error
Browse files Browse the repository at this point in the history
fix(router): log helpful error on missing viewport
  • Loading branch information
bryanrsmith committed Feb 13, 2016
2 parents 28ac295 + 224f5ac commit 31fd5a0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/navigation-plan.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export function _buildNavigationPlan(instruction: NavigationInstruction, forceLi
for (let viewPortName in prev.viewPortInstructions) {
let prevViewPortInstruction = prev.viewPortInstructions[viewPortName];
let nextViewPortConfig = config.viewPorts[viewPortName];

if (!nextViewPortConfig) throw new Error(`Invalid Route Config: Configuration for viewPort "${viewPortName}" was not found for route: "${instruction.config.route}."`);

let viewPortPlan = plan[viewPortName] = {
name: viewPortName,
config: nextViewPortConfig,
Expand Down

0 comments on commit 31fd5a0

Please sign in to comment.