Changeset 1745

Show
Ignore:
Timestamp:
26/07/2007 22:40:45 (18 months ago)
Author:
chris
Message:

Add more debugging checks and messages for location setup error
reported by Pete Jalajas
(http://lists.warhead.org.uk/pipermail/boxbackup/2007-July/003668.html)
(refs #3, merges [1728])

Location:
box/chris/general
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • box/chris/general/bin/bbackupd/BackupDaemon.cpp

    r1673 r1745  
    16971697#endif // HAVE_STRUCT_STATVFS_F_MNTONNAME 
    16981698                                { 
    1699                                         THROW_EXCEPTION(CommonException, OSFileError) 
     1699                                        BOX_WARNING("Failed to stat location: " 
     1700                                                << ploc->mPath  
     1701                                                << ": " << strerror(errno)); 
     1702                                        THROW_EXCEPTION(CommonException, 
     1703                                                OSFileError) 
    17001704                                } 
    17011705 
     
    17821786                                 
    17831787                                // Execute create directory command 
    1784                                 MemBlockStream attrStream(attr); 
    1785                                 std::auto_ptr<BackupProtocolClientSuccess> dirCreate(connection.QueryCreateDirectory( 
    1786                                         BackupProtocolClientListDirectory::RootDirectory, 
    1787                                         attrModTime, dirname, attrStream)); 
    1788                                          
    1789                                 // Object ID for later creation 
    1790                                 oid = dirCreate->GetObjectID(); 
     1788                                try 
     1789                                { 
     1790                                        MemBlockStream attrStream(attr); 
     1791                                        std::auto_ptr<BackupProtocolClientSuccess> dirCreate(connection.QueryCreateDirectory( 
     1792                                                BackupProtocolClientListDirectory::RootDirectory, 
     1793                                                attrModTime, dirname, attrStream)); 
     1794                                                 
     1795                                        // Object ID for later creation 
     1796                                        oid = dirCreate->GetObjectID(); 
     1797                                } 
     1798                                catch (BoxException &e) 
     1799                                { 
     1800                                        BOX_ERROR("Failed to create remote " 
     1801                                                "directory '/" << dirname << 
     1802                                                "', skipping location."); 
     1803                                        continue; 
     1804                                } 
     1805 
    17911806                        } 
    17921807 
     
    17981813                        // Push it back on the vector of locations 
    17991814                        mLocations.push_back(ploc); 
     1815                } 
     1816                catch (std::exception &e) 
     1817                { 
     1818                        delete ploc; 
     1819                        ploc = 0; 
     1820                        BOX_ERROR("Failed to setup location '" 
     1821                                << ploc->mName << "' path '" 
     1822                                << ploc->mPath << "': " << e.what()); 
     1823                        throw; 
    18001824                } 
    18011825                catch(...) 
  • box/chris/general/lib/win32/emu.cpp

    r1685 r1745  
    429429        if (pWide == NULL) 
    430430        { 
     431                ::syslog(LOG_ERR, "Failed to convert string '%s' from " 
     432                        "current code page %d to wide string: %s", 
     433                        rSource.c_str(), sourceCodePage, 
     434                        GetErrorMessage(GetLastError()).c_str()); 
    431435                return false; 
    432436        } 
     
    437441        if (!pConsole) 
    438442        { 
     443                // Error should have been logged by ConvertFromWideString 
    439444                return false; 
    440445        }