Index: trunk/SophyaLib/BaseTools/fiondblock.cc
===================================================================
--- trunk/SophyaLib/BaseTools/fiondblock.cc	(revision 1962)
+++ trunk/SophyaLib/BaseTools/fiondblock.cc	(revision 1967)
@@ -9,4 +9,6 @@
 #include "pexceptions.h"
 #include "fiondblock.h"
+#include "datatype.h"
+#include <typeinfo>
 
 ////////////////////////////////////////////////////////////////
@@ -71,5 +73,10 @@
 {
 NDataBlock<T> * po = dynamic_cast< NDataBlock<T> * >(&o);
-if (po == NULL) throw TypeMismatchExc("FIO_NDataBlock<T>::SetDataObj() - Type Mismatch Error");
+if (po == NULL) {
+  char buff[160];
+  sprintf(buff,"FIO_NDataBlock<T><%s>::SetDataObj(%s) - Object type  error ! ",
+	  DataTypeInfo<T>::getTypeName().c_str(), typeid(o).name());
+  throw TypeMismatchExc(PExcLongMessage(buff));    
+}
 if (ownobj && dobj) delete dobj;
 dobj = po; ownobj = false;
Index: trunk/SophyaLib/BaseTools/objfio.h
===================================================================
--- trunk/SophyaLib/BaseTools/objfio.h	(revision 1962)
+++ trunk/SophyaLib/BaseTools/objfio.h	(revision 1967)
@@ -27,7 +27,15 @@
   virtual   AnyDataObj* DataObj() { return(dobj); }
   virtual   void        SetDataObj(AnyDataObj & o) 
-          {  T * po = dynamic_cast< T * >(& o); if (po == NULL) return;
-	  if (ownobj && dobj) delete dobj;  dobj = po; ownobj = false; }    
-
+  {  
+    T * po = dynamic_cast< T * >(& o); 
+    if (po == NULL)  {
+      char buff[160];
+      sprintf(buff,"ObjFileIO<T>::SetDataObj(%s) - Object type  error ! ",
+	      typeid(o).name());
+      throw TypeMismatchExc(PExcLongMessage(buff));    
+    }
+    if (ownobj && dobj) delete dobj;  dobj = po; ownobj = false; 
+  }    
+  
   inline operator T() { return(*dobj); }
 
Index: trunk/SophyaLib/BaseTools/sversion.h
===================================================================
--- trunk/SophyaLib/BaseTools/sversion.h	(revision 1962)
+++ trunk/SophyaLib/BaseTools/sversion.h	(revision 1967)
@@ -3,6 +3,6 @@
 
 #define SOPHYA_VERSION   1.3
-#define SOPHYA_REVISION  55 
-#define SOPHYA_TAG       "V_Jan2002"
+#define SOPHYA_REVISION  60
+#define SOPHYA_TAG       "V_Mar2002"
 
 #endif
Index: trunk/SophyaLib/NTools/cimage.cc
===================================================================
--- trunk/SophyaLib/NTools/cimage.cc	(revision 1962)
+++ trunk/SophyaLib/NTools/cimage.cc	(revision 1967)
@@ -8,4 +8,6 @@
 #include "pexceptions.h"
 #include "cimage.h"
+#include "datatype.h"
+#include <typeinfo>
 
 /*!
@@ -115,5 +117,10 @@
 {
   Image<T> * po = dynamic_cast< Image<T> * >(&o);
-  if (po == NULL) return;
+  if (po == NULL) {
+    char buff[160];
+    sprintf(buff,"FIO_Image<%s>::SetDataObj(%s) - Object type  error ! ",
+	    DataTypeInfo<T>::getTypeName().c_str(), typeid(o).name());
+    throw TypeMismatchExc(PExcLongMessage(buff));        
+  }
   if (ownobj && dobj) delete dobj;
   dobj = po; ownobj = false;
Index: trunk/SophyaLib/SkyMap/fiolocalmap.cc
===================================================================
--- trunk/SophyaLib/SkyMap/fiolocalmap.cc	(revision 1962)
+++ trunk/SophyaLib/SkyMap/fiolocalmap.cc	(revision 1967)
@@ -4,4 +4,6 @@
 #include "pexceptions.h"
 #include "fiondblock.h"
+#include "datatype.h"
+#include <typeinfo>
 
 //*******************************************************************
@@ -72,5 +74,10 @@
 {
   LocalMap<T> * po = dynamic_cast< LocalMap<T> * >(&o);
-  if (po == NULL) return;
+  if (po == NULL) {
+    char buff[160];
+    sprintf(buff,"FIO_LocalMap<%s>::SetDataObj(%s) - Object type  error ! ",
+	    DataTypeInfo<T>::getTypeName().c_str(), typeid(o).name());
+    throw TypeMismatchExc(PExcLongMessage(buff));    
+  }
   if (ownobj && dobj) delete dobj;
   dobj = po; ownobj = false;
Index: trunk/SophyaLib/SkyMap/fiospherethetaphi.cc
===================================================================
--- trunk/SophyaLib/SkyMap/fiospherethetaphi.cc	(revision 1962)
+++ trunk/SophyaLib/SkyMap/fiospherethetaphi.cc	(revision 1967)
@@ -4,4 +4,6 @@
 #include "pexceptions.h"
 #include "fiondblock.h"
+#include "datatype.h"
+#include <typeinfo>
 
 ///////////////////////////////////////////////////////////
@@ -57,5 +59,11 @@
 {
   SphereThetaPhi<T> * po = dynamic_cast< SphereThetaPhi<T> * >(&o);
-  if (po == NULL) return;
+  if (po == NULL) {
+    char buff[160];
+    sprintf(buff,"FIO_SphereThetaPhi<%s>::SetDataObj(%s) - Object type  error ! ",
+	    DataTypeInfo<T>::getTypeName().c_str(), typeid(o).name());
+    throw TypeMismatchExc(PExcLongMessage(buff));    
+  }
+
   if (ownobj && dobj) delete dobj;
   dobj = po; ownobj = false;
Index: trunk/SophyaLib/SkyMap/spherepos.cc
===================================================================
--- trunk/SophyaLib/SkyMap/spherepos.cc	(revision 1962)
+++ trunk/SophyaLib/SkyMap/spherepos.cc	(revision 1967)
@@ -2,6 +2,8 @@
 
 #include "spherepos.h"
+#include "datatype.h"
+#include <typeinfo>
 
-static char *head_spherepos_cc_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/SkyMap/spherepos.cc,v 1.1.1.1 2000-03-02 17:05:39 ansari Exp $";
+static char *head_spherepos_cc_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/SkyMap/spherepos.cc,v 1.2 2002-04-26 16:48:22 ansari Exp $";
 
 
@@ -72,5 +74,11 @@
 {
   SphereCoordSys * po = dynamic_cast<SphereCoordSys *>(&o);
-  if (po == NULL) return;
+  if (po == NULL) {
+    char buff[160];
+    sprintf(buff,"FIO_SphereCoordSys::SetDataObj(%s) - Object type  error ! ",
+	    typeid(o).name());
+    throw TypeMismatchExc(PExcLongMessage(buff));    
+  }
+
   if (ownobj && dobj) delete dobj;  
   dobj = po; ownobj = false;
