You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ar...@locus.apache.org on 2000/01/25 23:33:13 UTC

cvs commit: xml-xerces/c/src/util/Platforms/UnixWare UnixWarePlatformUtils.cpp

aruna1      00/01/25 14:33:13

  Modified:    c/src/util/Platforms/UnixWare UnixWarePlatformUtils.cpp
  Log:
  Updated panic information
  
  Revision  Changes    Path
  1.2       +22 -35    xml-xerces/c/src/util/Platforms/UnixWare/UnixWarePlatformUtils.cpp
  
  Index: UnixWarePlatformUtils.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/Platforms/UnixWare/UnixWarePlatformUtils.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UnixWarePlatformUtils.cpp	1999/12/17 22:24:03	1.1
  +++ UnixWarePlatformUtils.cpp	2000/01/25 22:33:13	1.2
  @@ -56,6 +56,9 @@
   
   /**
    * $Log: UnixWarePlatformUtils.cpp,v $
  + * Revision 1.2  2000/01/25 22:33:13  aruna1
  + * Updated panic information
  + *
    * Revision 1.1  1999/12/17 22:24:03  rahulj
    * Added missing UnixWare files to the repository.
    *
  @@ -242,11 +245,7 @@
       handle = dlopen(libName, RTLD_LAZY);
       if (!handle)
       {
  -        char errorBuffer[1024];
  -        sprintf(errorBuffer,
  -                "Fatal error: Could not open library '%s'", libName);
  -        perror (errorBuffer);
  -        panic(XMLPlatformUtils::Panic_NoTransService);
  +        panic(XMLPlatformUtils::Panic_CantFindLib);
       }
   
       int       ret = 0;
  @@ -277,15 +276,6 @@
   
       if (fgIntlPath == NULL)
       {
  -        fprintf(stderr,
  -                "Fatal error: Could not find /icu/data relative to %s \n",
  -                libName);
  -        fprintf(stderr, 
  -                "             while trying to auto detect the location ");
  -        fprintf(stderr, "of the converter files.\n");
  -        fprintf(stderr,
  -                "             And the environment variable 'ICU_DATA' is ");
  -        fprintf(stderr, "not defined.\n");
           panic(XMLPlatformUtils::Panic_NoTransService);
       }
   
  @@ -305,26 +295,23 @@
   // ---------------------------------------------------------------------------
   void XMLPlatformUtils::panic(const PanicReasons reason)
   {
  -    //
  -    //  We just print a message and exit
  -    //
  -    
  -    fprintf(stderr,
  -            "The XML4C system could not be initialized.\n");
  -    fprintf(stderr,
  -            "The most likely reason for this failure is the inability to find\n");
  -    fprintf(stderr,
  -            "the ICU coverter files, if you are using ICU. The converter files\n");
  -    fprintf(stderr,
  -            "have the extension .cnv and exist in a directory 'icu/data' relative\n");
  -    fprintf(stderr,
  -            "to the XML4C shared library. If you have installed the converter files\n");
  -    fprintf(stderr,
  -            "in a different location, you need to set up the environment variable\n");
  -    fprintf(stderr,
  -            "'ICU_DATA' to point directly to the directory containing the\n");
  -    fprintf(stderr,
  -            "converter files.\n");
  +	 const char* reasonStr = "Unknown reason";
  +    if (reason == Panic_NoTransService)
  +        reasonStr = "Could not load a transcoding service";
  +    else if (reason == Panic_NoDefTranscoder)
  +        reasonStr = "Could not load a local code page transcoder";
  +    else if (reason == Panic_CantFindLib)
  +        reasonStr = "Could not find the xerces-c DLL";
  +    else if (reason == Panic_UnknownMsgDomain)
  +        reasonStr = "Unknown message domain";
  +    else if (reason == Panic_CantLoadMsgDomain)
  +        reasonStr = "Cannot load message domain";
  +    else if (reason == Panic_SynchronizationErr)
  +        reasonStr = "Cannot synchronize system or mutex";
  +    else if (reason == Panic_SystemInit)
  +        reasonStr = "Cannot initialize the system or mutex";
  +
  +    fprintf(stderr, "%s\n", reasonStr);
       
       exit(-1);
   }