Index: /trunk/src/read_upf.c
===================================================================
--- /trunk/src/read_upf.c	(revision 123)
+++ /trunk/src/read_upf.c	(revision 125)
@@ -66,9 +66,9 @@
   narg = sscanf (line, "%2c",&kind_ps[0]); // read the kind of pseudo-potentials US|NC|PAW    "Ultrasoft|Norm conserving|Projector-augmented" 
   PSPIO_ASSERT(narg==1, PSPIO_EIO);	
+  //LIBPSP_IO can only read norm-conserving pseudo-potentials from UPF format.
   if (!strncpm(kind_ps,"NC",2)) {
-    printf("LIBPSP_IO can only read norm-conserving pseudo-potentials from UPF format.");
-    return PSPIO_ETYPE;
-  }
-	
+    HANDLE_ERROR(PSPIO_ENOSUPPORT);
+  }
+  
   if(fgets(line, MAX_STRLEN, fp) == NULL) {
     HANDLE_ERROR(PSPIO_EIO);
Index: /trunk/src/pspio_error.c
===================================================================
--- /trunk/src/pspio_error.c	(revision 120)
+++ /trunk/src/pspio_error.c	(revision 125)
@@ -125,4 +125,6 @@
     case PSPIO_ENOMEM:
       return "malloc failed";
+    case PSPIO_NOSUPPORT:
+      return "No supported option in the pseudo-potential file";
     default:
       return "unknown error code" ;
Index: /trunk/src/pspio_error.h
===================================================================
--- /trunk/src/pspio_error.h	(revision 115)
+++ /trunk/src/pspio_error.h	(revision 125)
@@ -43,5 +43,5 @@
 #define PSPIO_EGSL  6
 #define PSPIO_ENOMEM 7
-
+#define PSPIO_ENOSUPPORT 8
 
 /**********************************************************************
