Changeset 28089

Show
Ignore:
Timestamp:
19.08.2013 23:50:02 (6 years ago)
Author:
davidb
Message:

Additional error message details added

Location:
main/trunk/greenstone2/common-src/src/gdbmedit
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/src/gdbmedit/db2txt/db2txt.cpp

    r27627 r28089  
    3232#else 
    3333#include <gdbm.h> 
     34#include <errno.h> 
    3435#endif 
    3536 
     
    136137#endif 
    137138  if (dbf == NULL) { 
    138     cerr << argv[0] << ": couldn't open " << dbname << endl; 
    139     exit (0); 
     139    cerr << argv[0] << ": Couldn't open '" << dbname << "'" << endl; 
     140    cerr << "  " << gdbm_strerror(gdbm_errno) << endl; 
     141    cerr << "  gdbm errno = " << gdbm_errno << endl; 
     142#ifndef _MSC_VER 
     143    cerr << "  OS errno = " << errno << endl; 
     144    perror("gdbm_open failed: "); 
     145#endif 
     146 
     147    exit (-1); 
    140148  } 
    141149 
  • main/trunk/greenstone2/common-src/src/gdbmedit/txt2db/txt2db.cpp

    r26650 r28089  
    3636#else 
    3737#include <gdbm.h> 
     38#include <errno.h> 
    3839#endif 
    3940 
     
    101102#endif 
    102103  if (dbf == NULL) { 
    103     cerr << "couldn't create " << dbname << endl; 
    104     exit (0); 
     104    cerr << argv[0] << ": Couldn't create/open '" << dbname << "'" << endl; 
     105    cerr << "  " << gdbm_strerror(gdbm_errno) << endl; 
     106    cerr << "  gdbm errno = " << gdbm_errno << endl; 
     107#ifndef _MSC_VER 
     108    cerr << "  OS errno = " << errno << endl; 
     109    perror("gdbm_open failed: "); 
     110#endif 
     111 
     112    exit (-1); 
    105113  } 
    106114