pageflow.ThemesCollection = Backbone.Collection.extend({
  model: pageflow.Theme,

  findByName: function(name) {
    return this.findWhere({name: name});
  }
});

pageflow.ThemesCollection = Backbone.Collection.extend({
  model: pageflow.Theme,

  findByName: function(name) {
    var theme = this.findWhere({name: name});

    if (!theme) {
      throw new Error('Found no theme by name ' + name);
    }

    return theme;
  }
});

Throw error when ThemeCollection does not have theme by that name
Throw error when ThemeCollection does not have theme by that name
