input: Write a function to classify emails from the Enron Spam Dataset as either spam or non-spam. The function should load the dataset, preprocess the data, train a Support Vector Machine (SVM) model, and return the precision score of the model. If the dataset cannot be loaded, the function should return an error message.
  assert classify_emails("spam.csv") > 0.8
  assert classify_emails("nonexistent.csv")=="Error: Unable to load dataset."
output: def classify_emails(filename):
      try:
          import pandas as pd
          from sklearn.model_selection import train_test_split
          from sklearn.feature_extraction.text import TfidfVectorizer
          from sklearn.svm import SVC
          from sklearn.metrics import precision_score
          
          df = pd.read_csv(filename)
          X = df['text']
          y = df['label']
          
          X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
          
          vectorizer = TfidfVectorizer()
          X_train_tfidf = vectorizer.fit_transform(X_train)
          X_test_tfidf = vectorizer.transform(X_test)
          
          svm = SVC()
          svm.fit(X_train_tfidf, y_train)
          
          y_pred = svm.predict(X_test_tfidf)
          precision = precision_score(y_test, y_pred, pos_label='spam')
          
          return precision
      except Exception as e:
          return "Error: Unable to load dataset."