#ifndef __OBJECT_ERROR_H__
#define __OBJECT_ERROR_H__

#include "Environment.h"

namespace AScript {

//-----------------------------------------------------------------------------
// Class_Error / Object_Error
//-----------------------------------------------------------------------------
class Class_Error : public Class {
public:
	Class_Error(Class *pClassSuper, const Symbol *pSymbol);
	virtual Object *CreateDescendant(Environment &env, Signal sig, Class *pClass);
};

class Object_Error : public Object {
public:
	inline static Object_Error *GetSelfObj(Context &context) {
		return dynamic_cast<Object_Error *>(context.GetSelfObj());
	}
private:
	ErrorType _errType;
public:
	inline Object_Error(Class *pClass, ErrorType errType) :
									Object(pClass), _errType(errType) {}
	Object_Error(const Object_Error &obj);
	virtual ~Object_Error();
	virtual Object *Clone() const;
	virtual String ToString(Signal sig, bool exprFlag);
	inline ErrorType GetErrorType() const { return _errType; }
};

}

#endif
