<?php

/**
 * Class for saving normal exceptions for serialization.
 *
 * This class is used by the SimpleSAML_Auth_State class when it needs
 * to serialize an exception which doesn't subclass the
 * SimpleSAML_Error_Exception class.
 *
 * It creates a new exception which contains the backtrace and message
 * of the original exception.
 *
 * @package simpleSAMLphp
 * @version $Id$
 */
class SimpleSAML_Error_UnserializableException extends SimpleSAML_Error_Exception {

	public function __construct(Exception $original) {

		$msg = get_class($original) . ': ' . $original->getMessage();
		$code = $original->getCode();
		parent::__construct($msg, $code);

		$this->setBacktrace(SimpleSAML_Utilities::buildBacktrace($original));
	}

}
Add exception for serializing unserializable exceptions.
Add exception for serializing unserializable exceptions.

The SimpleSAML_Error_Exception class is a base class for serializable
exceptions. This patch adds SimpleSAML_Error_UnserializableException.
That class saves some of the information from an Exception and saves it
in an serializable exception.

git-svn-id: a243b28a2a52d65555a829a95c8c333076d39ae1@1564 44740490-163a-0410-bde0-09ae8108e29a
