Better error message on startup / drizzled.cc

Bug #943657 reported by Henrik Ingo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
Low
Mohit Srivastava

Bug Description

In drizzled/drizzled.cc several checks are made on startup and if they fail then drizzled will abort with an error message.

For instance if I do

  sbin/drizzled --foo

then I will get the error

Aborting:"Use --help to get a list of available options. unknown option foo". Abort was called from drizzled/drizzled.cc:1369 in init_variables_after_daemonizing()

This is a result of following code:

  catch (po::unknown_option &err)
  {
    unireg_abort << "Use --help to get a list of available options. " << err.what();

The error message is very confusing, lacks spaces and capitalization. It would be much better if it was worded like this:

Aborting: Unknown option foo. Use --help to get a list of available options.
  Abort was called from drizzled/drizzled.cc:1369 in init_variables_after_daemonizing()

Related branches

Revision history for this message
Mohit Srivastava (mohyt) wrote :

"unknown option foo" is described by a boost::program_options::unknown_option(foo) , and this is thrown as a exception.

To format "unknown option foo" as "Unknown option foo" , either boost function need to be modified or string manipulation should be performed on error msg thrown by boost.
And modification in boost lib is not related with drizzle .

So still we need such formatting?

Revision history for this message
Henrik Ingo (hingo) wrote :

No, you're right. Modifying boost is outside the scope of this bug. It is ok for that message to remain lowercase, it would then become "Aborted: unknown option foo. Use --help ..."

Revision history for this message
Mohit Srivastava (mohyt) wrote :

Alright I am doing it then.

Changed in drizzle:
assignee: nobody → mohit srivastava (srivastavamohit91)
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

I remind us of http://blog.krow.net/2012/02/error-messages.html

Long-term, ultimately, it will really help Drizzle to have some sort of consistency for its error messages. I know, for example, that some people actively watch the error log, particularly when they deploy new boxes. The easier, more consistent Drizzle error messages, the easier it will be to detect when a new box has broken. And since Drizzle is a database for the cloud, we should expect Drizzle servers to be virtualized/puppetized/deployed in automated ways, thereby making checks for consistency all the more important.

Mohit Srivastava (mohyt)
Changed in drizzle:
status: Confirmed → Fix Committed
Revision history for this message
Stewart Smith (stewart) wrote : Re: [Bug 943657] Re: Better error message on startup / drizzled.cc

On Sat, 17 Mar 2012 08:30:03 -0000, mohit srivastava <email address hidden> wrote:
> "unknown option foo" is described by a
> boost::program_options::unknown_option(foo) , and this is thrown as a
> exception.
>
> To format "unknown option foo" as "Unknown option foo" , either boost function need to be modified or string manipulation should be performed on error msg thrown by boost.
> And modification in boost lib is not related with drizzle .

Do feel free to submit a patch to Boost though, in the Drizzle project
we do favor fixing upstream when possible- after all, we're all open
source projects and contributors.

--
Stewart Smith

Revision history for this message
Henrik Ingo (hingo) wrote :

I think the point wrt Boost is that it is not clear those messages should be universally uppercase either. I actually think it is ok as they are and also works for our purposes.

Henrik Ingo (hingo)
Changed in drizzle:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.