if ( retval.records.which == Records_type.nonsurrogatediagnostic_CID )
{
// Record contains defaultDiagFormat object
DefaultDiagFormat_type d = (DefaultDiagFormat_type)retval.records.o;
if ( d.addinfo != null )
throw new Z3950Exception("Diagnostic ["+d.condition+"] Additional Info : "+d.addinfo.o);
else
throw new Z3950Exception("Diagnostic ["+d.condition+"] no additional info");
}
else if ( retval.records.which == Records_type.multiplenonsurdiagnostics_CID )
{
// Record contains DiagRec ( May have externally defined info )
DiagRec_type d = (DiagRec_type)retval.records.o;
if ( d.which == DiagRec_type.defaultformat_CID )
{
DefaultDiagFormat_type dd = (DefaultDiagFormat_type) d.o;
throw new Z3950Exception("Diagnostic ["+dd.condition+"] Additional Info : "+dd.addinfo.o);
}
else
throw new Z3950Exception("Externally defined diagnostic record");
}
else
{
System.err.println("Search has valid piggyback records");
}