# HG changeset patch # User Sebastien Jodogne # Date 1449315919 -3600 # Node ID a6c431193c79bdd0b8c987731ef40116e4d6b59f # Parent 9af3b492b0104a4a0f85854f40a05543a04a3991 Improved logging information if upgrade fails diff -r 9af3b492b010 -r a6c431193c79 NEWS --- a/NEWS Sat Dec 05 11:22:17 2015 +0100 +++ b/NEWS Sat Dec 05 12:45:19 2015 +0100 @@ -3,6 +3,7 @@ * Fix modality worklists server if some fields are null * More tolerant "/series/.../ordered-slices" with broken series +* Improved logging information if upgrade fails Version 0.9.5 (2015/12/02) diff -r 9af3b492b010 -r a6c431193c79 OrthancServer/ServerToolbox.cpp --- a/OrthancServer/ServerToolbox.cpp Sat Dec 05 11:22:17 2015 +0100 +++ b/OrthancServer/ServerToolbox.cpp Sat Dec 05 12:45:19 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; + } } } }