{
        Diagnostic diagnostic = null;
        if (resourceDiagnostic instanceof Throwable)
        {
          diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic);
        }
        else
        {
          diagnostic = new BasicDiagnostic(
            Diagnostic.ERROR,
            "org.eclipse.emf.ecore.resource", 
            0, 
            resourceDiagnostic.getMessage(),
            new Object[]{resourceDiagnostic});
        }
        basicDiagnostic.add(diagnostic);
      }