From 8cdf090f4d08fd17302771544c88892e6203d99d Mon Sep 17 00:00:00 2001 From: jpr Date: Wed, 20 Jul 2005 13:39:51 +0000 Subject: [PATCH] Warn user when something wrong happens --- Example/PrintFile.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index 771f07c7..c28009c0 100644 --- a/Example/PrintFile.cxx +++ b/Example/PrintFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintFile.cxx,v $ Language: C++ - Date: $Date: 2005/07/07 17:31:53 $ - Version: $Revision: 1.45 $ + Date: $Date: 2005/07/20 13:39:51 $ + Version: $Revision: 1.46 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -181,10 +181,17 @@ int main(int argc, char *argv[]) gdcm::File *f = new gdcm::File(); f->SetLoadMode(loadMode); f->SetFileName( fileName ); - bool res = f->Load(); // just to see + bool res = f->Load(); if ( !res ) { + std::cout << "Cannot process file [" << fileName << "]" << std::endl; + std::cout << "Either it doesn't exist, or it's read protected " + << std::endl; + std::cout << "or it's not a Dicom File, or its 'header' is bugged" + << std::endl; + std::cout << "use 'PrintFile filein=... debug' to try to guess the pb" + << std::endl; delete f; return 0; } -- 2.48.1