~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/module/registry.h

  • Committer: Brian Aker
  • Date: 2011-07-18 02:56:15 UTC
  • mto: (2392.1.1 drizzle-autoconf)
  • mto: This revision was merged to the branch mainline in revision 2399.
  • Revision ID: brian@tangent.org-20110718025615-2an7nztjcb38c2ur
Add better error messages for issues on startup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
    std::string plugin_name(boost::to_lower_copy(plugin->getName()));
98
98
    if (find_ptr(plugin_registry, std::make_pair(plugin_type, plugin_name)))
99
99
    {
100
 
      errmsg_printf(error::ERROR, _("Loading plugin %s failed: a %s plugin by that name already exists.\n"), 
101
 
        plugin->getTypeName().c_str(), plugin->getName().c_str());
102
 
      failed= true;
103
 
    }
104
 
    if (T::addPlugin(plugin)) // Olaf: Should addPlugin be called when failed is already true?
105
 
      failed= true; 
 
100
      std::string error_message;
 
101
      error_message+=  _("Loading plugin failed, a plugin by that name already exists.");
 
102
      error_message+= plugin->getTypeName();
 
103
      error_message+= ":";
 
104
      error_message+= plugin->getName();
 
105
      unireg_actual_abort(__FILE__, __LINE__, __func__, error_message);
 
106
    }
 
107
 
 
108
    if (T::addPlugin(plugin))
 
109
    {
 
110
      std::string error_message;
 
111
      error_message+= _("Fatal error: Failed initializing: ");
 
112
      error_message+= plugin->getTypeName();
 
113
      error_message+= ":";
 
114
      error_message+= plugin->getName();
 
115
      unireg_actual_abort(__FILE__, __LINE__, __func__, error_message);
 
116
    }
106
117
 
107
118
    if (failed)
108
119
    {
109
 
      errmsg_printf(error::ERROR, _("Fatal error: Failed initializing %s::%s plugin.\n"), 
110
 
        plugin->getTypeName().c_str(), plugin->getName().c_str());
111
 
      unireg_abort(1);
 
120
      unireg_abort << _("Fatal error: Failed initializing: ") << plugin->getTypeName() << ":" << plugin->getName();
112
121
    }
113
122
    plugin_registry.insert(std::make_pair(std::make_pair(plugin_type, plugin_name), plugin));
114
123
  }