/***************************************************************************
 * MException
 *
 * Mayaのエラーを捕らえた時点で投げられる例外クラス
 * what()でコメント、status()でMStatusが得られる。
 **************************************************************************/

#ifndef ATS_MEXCEPTION_H
#define ATS_MEXCEPTION_H

#include <string>
#include <maya/MGlobal.h>

namespace ats
{
	class MException : public std::exception
	{
	private:
		std::string m_msg;
		MStatus m_state;

	public:
		MException(const char* msg, const MStatus& state) throw()
		: m_msg(msg), m_state(state)
		{}
		MException(const std::string& msg, const MStatus& state) throw()
		: m_msg(msg), m_state(state)
		{}
		virtual ~MException() throw()
		{}
		virtual const char *what() const throw()
		{
			return m_msg.c_str();
		}
		virtual MStatus status() const throw()
		{
			return m_state;
		}
	};
}
#endif
