Mailinglist Archive: zypp-devel (68 mails)

< Previous Next >
[zypp-devel] Try to produce speaking error message / document nonobvious facts
  • From: Michael Andres <ma@xxxxxxx>
  • Date: Thu, 3 May 2007 23:53:38 +0200
  • Message-id: <20070503215338.GA18228@xxxxxxx>
Example:


Call to

  cache::CacheStore( "./store" );

results in

  [zypp] Exception.cc(log):94 CacheInitializer.cpp(CacheInitializer):57
  RETHROW:  ():0: unable to open database
  terminate called after throwing an instance of 'sqlite3x::database_error'
    what():  unable to open database

No further error messages.



Documentation says:
      /**
       * Constructor for the CacheStore
       *
       * \note a transaction will be started from the moment the
       * CacheStore is instanciated.
       *
       * The data will be saved in the directory specified in
       * \a dbdir
       */
      CacheStore( const Pathname &dbdir );

Hmm? 
dbdir must exist? 
parent must exist?
Error/Exception if not creatable?



Tried: mkdir ./store

Still throws.



Tried: cache::CacheStore( "/home/ma/zypp-trunk/BUILD/libzypp/store" );

Success!



a) Pathname has a method telling whether it's absolute/relative. It should 
be possible to prepend $PWD to create an absolute path. IMO constraints 
like this must not be.

If they must be, throw and report what actually causes the error.


b) Remember that the log is what you find in bugzilla later. If 
information is missing, people may assume we never tested that case ;)

-- 

cu,
    Michael Andres

+------------------------------------------------------------------+
Key fingerprint = 2DFA 5D73 18B1 E7EF A862  27AC 3FB8 9E3A 27C6 B0E4
+------------------------------------------------------------------+
Michael Andres             YaST Development            ma@xxxxxxxxxx
SUSE LINUX Products GmbH, GF:  Markus Rex,  HRB 16746 (AG Nuernberg)
Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0
+------------------------------------------------------------------+

-- 
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages