Update of /cvsroot/refdb/refdb/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18405
Modified Files:
noteshandler.c
Log Message:
inserting link with missing target is no longer an error but a warning
Index: noteshandler.c
===================================================================
RCS file: /cvsroot/refdb/refdb/src/noteshandler.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -U2 -r1.13 -r1.14
--- noteshandler.c 25 Jan 2004 13:23:38 -0000 1.13
+++ noteshandler.c 29 Jan 2004 01:35:27 -0000 1.14
@@ -722,5 +722,5 @@
result = insert_link(type, target, ptr_andata->conn, ptr_andata->driver, ptr_andata->n_note_id);
- if (result > 0 && result < 7) {
+ if (result == 1 /* out of memory */) {
LOG_PRINT(LOG_WARNING, outomem.text);
if ((new_msgpool = mstrcat(ptr_andata->msgpool, outomem_n.text, &(ptr_andata->msgpool_len), 0)) == NULL) {
@@ -734,4 +734,62 @@
return;
}
+ else if (result == 2 /* incorrect link type */) {
+ LOG_PRINT(LOG_WARNING, "insert_link(): incorrect link type");
+ if ((new_msgpool = mstrcat(ptr_andata->msgpool, "incorrect link type\n", &(ptr_andata->msgpool_len), 0)) == NULL) {
+ (ptr_andata->nmem_error)++;
+ return;
+ }
+ else {
+ ptr_andata->msgpool = new_msgpool;
+ }
+ (ptr_andata->ndb_error)++;
+ return;
+ }
+ else if (result == 3 /* xref query failed */) {
+ LOG_PRINT(LOG_WARNING, "insert_link(): xref query failed");
+ if ((new_msgpool = mstrcat(ptr_andata->msgpool, "xref query failed\n", &(ptr_andata->msgpool_len), 0)) == NULL) {
+ (ptr_andata->nmem_error)++;
+ return;
+ }
+ else {
+ ptr_andata->msgpool = new_msgpool;
+ }
+ (ptr_andata->ndb_error)++;
+ return;
+ }
+ else if (result == 4 /* missing target */) {
+ LOG_PRINT(LOG_INFO, "insert_link(): missing link target");
+ if ((new_msgpool = mstrcat(ptr_andata->msgpool, "missing link target\n", &(ptr_andata->msgpool_len), 0)) == NULL) {
+ (ptr_andata->nmem_error)++;
+ return;
+ }
+ else {
+ ptr_andata->msgpool = new_msgpool;
+ }
+ }
+ else if (result == 5 /* xnote query failed */) {
+ LOG_PRINT(LOG_WARNING, "insert_link(): xnote query failed");
+ if ((new_msgpool = mstrcat(ptr_andata->msgpool, "xnote query failed\n", &(ptr_andata->msgpool_len), 0)) == NULL) {
+ (ptr_andata->nmem_error)++;
+ return;
+ }
+ else {
+ ptr_andata->msgpool = new_msgpool;
+ }
+ (ptr_andata->ndb_error)++;
+ return;
+ }
+ else if (result == 6 /* insert into t_xnote failed */) {
+ LOG_PRINT(LOG_WARNING, "insert_link(): insert into t_xnote failed");
+ if ((new_msgpool = mstrcat(ptr_andata->msgpool, "insert into t_xnote failed\n", &(ptr_andata->msgpool_len), 0)) == NULL) {
+ (ptr_andata->nmem_error)++;
+ return;
+ }
+ else {
+ ptr_andata->msgpool = new_msgpool;
+ }
+ (ptr_andata->ndb_error)++;
+ return;
+ }
/* else: all fine */
}
|