Changeset 2650


Ignore:
Timestamp:
2001-07-12T15:33:16+12:00 (23 years ago)
Author:
jrm21
Message:

added an error check - now returns an error string for some errors instead of
continuing (and later causing problems).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/packages/yaz/client/yaz_zclient.c

    r2547 r2650  
    55 *
    66 * $Log$
     7 * Revision 1.4  2001/07/12 03:33:16  jrm21
     8 * added an error check - now returns an error string for some errors instead of
     9 * continuing (and later causing problems).
     10 *
    711 * Revision 1.3  2001/06/13 04:22:26  jrm21
    812 * don't add <a href> tags for USMARC field 856 (online access), as it is not
     
    19261930  /* just do some double checking */
    19271931  if (*apdu->u.presentResponse->numberOfRecordsReturned!=1 ||
    1928       !apdu->u.presentResponse->records ||
    1929       apdu->u.presentResponse->records->which!=Z_Records_DBOSD) {
     1932      !apdu->u.presentResponse->records ) {
    19301933    /* something bad has happened... johnmcp */
    19311934    fprintf (stderr,"Error occured in yaz while getting record (GSDL)\n");
     1935  }
     1936
     1937  switch (apdu->u.presentResponse->records->which) {
     1938  case Z_Records_DBOSD: break; /* do nothing - this is a record */
     1939
     1940    /* otherwise we got a diagnostic message... */
     1941  case Z_Records_NSD:
     1942    switch (apdu->u.presentResponse->records->u.nonSurrogateDiagnostic->which){
     1943      /* these are both represented as char* in yaz, so either is OK */
     1944      /*    case Z_DefaultDiagForm_v2Addinfo:
     1945        case Z_DefaultDiagForm_v3Addinfo: --wrong names*/
     1946    case Z_DiagnosticFormat_s_defaultDiagRec:
     1947    case Z_DiagnosticFormat_s_explicitDiagnostic:
     1948      return apdu->u.presentResponse->records->u.nonSurrogateDiagnostic
     1949    ->u.v2Addinfo; /* return the error message */
     1950    default: ; /* this should happen for v3 of the spec... */
     1951    }
     1952  case Z_Records_multipleNSD: ; /* should handle one day... */
    19321953  }
    19331954
Note: See TracChangeset for help on using the changeset viewer.