# HG changeset patch # User Sebastien Jodogne # Date 1449478114 -3600 # Node ID 09a737a6bf3698bad6a520f11c416de93e20d471 # Parent e8146c9c28a4c821d4ce55d1e1cf10284ed7e35b# Parent a6c431193c79bdd0b8c987731ef40116e4d6b59f merge diff -r e8146c9c28a4 -r 09a737a6bf36 NEWS --- a/NEWS Mon Dec 07 09:46:37 2015 +0100 +++ b/NEWS Mon Dec 07 09:48:34 2015 +0100 @@ -4,6 +4,7 @@ * Fix modality worklists server if some fields are null * More tolerant "/series/.../ordered-slices" with broken series * Promiscuous mode is now turned off by default +* Improved logging information if upgrade fails Version 0.9.5 (2015/12/02) diff -r e8146c9c28a4 -r 09a737a6bf36 OrthancServer/ServerToolbox.cpp --- a/OrthancServer/ServerToolbox.cpp Mon Dec 07 09:46:37 2015 +0100 +++ b/OrthancServer/ServerToolbox.cpp Mon Dec 07 09:48:34 2015 +0100 @@ -322,6 +322,8 @@ tmp != level || !FindOneChildInstance(instance, database, resource, level)) { + LOG(ERROR) << "Cannot find an instance for " << EnumerationToString(level) + << " with identifier " << *it; throw OrthancException(ErrorCode_InternalError); } @@ -329,23 +331,33 @@ FileInfo attachment; if (!database.LookupAttachment(attachment, instance, FileContentType_Dicom)) { + LOG(ERROR) << "Cannot retrieve the DICOM file associated with instance " << database.GetPublicId(instance); throw OrthancException(ErrorCode_InternalError); } - // Read and parse the content of the DICOM file - StorageAccessor accessor(storageArea); + try + { + // Read and parse the content of the DICOM file + StorageAccessor accessor(storageArea); - std::string content; - accessor.Read(content, attachment); + std::string content; + accessor.Read(content, attachment); + + ParsedDicomFile dicom(content); - ParsedDicomFile dicom(content); + // Update the tags of this resource + DicomMap dicomSummary; + dicom.Convert(dicomSummary); - // Update the tags of this resource - DicomMap dicomSummary; - dicom.Convert(dicomSummary); - - database.ClearMainDicomTags(resource); - Toolbox::SetMainDicomTags(database, resource, level, dicomSummary); + database.ClearMainDicomTags(resource); + Toolbox::SetMainDicomTags(database, resource, level, dicomSummary); + } + catch (OrthancException&) + { + LOG(ERROR) << "Cannot decode the DICOM file with UUID " << attachment.GetUuid() + << " associated with instance " << database.GetPublicId(instance); + throw; + } } } } diff -r e8146c9c28a4 -r 09a737a6bf36 OrthancServer/main.cpp --- a/OrthancServer/main.cpp Mon Dec 07 09:46:37 2015 +0100 +++ b/OrthancServer/main.cpp Mon Dec 07 09:48:34 2015 +0100 @@ -835,7 +835,17 @@ LOG(WARNING) << "Upgrading the database from schema version " << currentVersion << " to " << ORTHANC_DATABASE_VERSION; - database.Upgrade(ORTHANC_DATABASE_VERSION, storageArea); + + try + { + database.Upgrade(ORTHANC_DATABASE_VERSION, storageArea); + } + catch (OrthancException&) + { + LOG(ERROR) << "Unable to run the automated upgrade, please use the replication instructions: " + << "https://orthanc.chu.ulg.ac.be/book/users/replication.html"; + throw; + } // Sanity check currentVersion = database.GetDatabaseVersion();