#ifndef GRAPRA_EXCEPTION_
#define GRAPRA_EXCEPTION_

#include <exception>
#include <boost/exception/all.hpp>

class Exception : public boost::exception, public std::exception {};

///Helper Class to formate SourceCode in Errormessages
class ShaderSource
{
public:
	ShaderSource(std::string Source);
	friend inline std::ostream& operator<<(std::ostream &Stream, const ShaderSource& Source);
private:
	std::string m_Source;
};

inline std::ostream& operator<<(std::ostream &Stream, const ShaderSource& Source)
{
	return Stream << Source.m_Source;
}

class ex_file_class
{
public:
	ex_file_class(std::string Filename);
	
	std::string Filename;
	std::string AbsFilename;
};

inline std::ostream& operator<<(std::ostream &Stream, const ex_file_class& file)
{
	return Stream << file.Filename << " loaded at: " << file.AbsFilename;
}

typedef boost::error_info<struct tag_error_message,std::string>	ex_message;
typedef boost::error_info<struct tag_error_detail,std::string>	ex_detail;

typedef boost::error_info<struct tag_error_file,ex_file_class>	ex_file;
typedef boost::error_info<struct tag_error_model,std::string>	ex_model;
typedef boost::error_info<struct tag_error_source,ShaderSource>	ex_source;

#define THROW(x) BOOST_THROW_EXCEPTION(x)



#endif
