lib
exception.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "object.h"
00021 #include "exception.h"
00022
00023
00024
00025
00026 using namespace Kross::Api;
00027
00028 Exception::Exception(const QString& error, long lineno)
00029 : Object()
00030 , m_error(error)
00031 , m_lineno(lineno)
00032 {
00033 krosswarning( QString("Kross::Api::Exception error='%1' lineno='%3'").arg(m_error).arg(m_lineno) );
00034 }
00035
00036 Exception::~Exception()
00037 {
00038 }
00039
00040 const QString Exception::getClassName() const
00041 {
00042 return "Kross::Api::Exception";
00043 }
00044
00045 const QString Exception::toString()
00046 {
00047 return (m_lineno != -1)
00048 ? QString("Exception at line %1: %2").arg(m_lineno).arg(m_error)
00049 : QString("Exception: %1").arg(m_error);
00050 }
00051
00052 const QString Exception::getError() const
00053 {
00054 return m_error;
00055 }
00056
00057 const QString Exception::getTrace() const
00058 {
00059 return m_trace;
00060 }
00061
00062 void Exception::setTrace(const QString& tracemessage)
00063 {
00064 m_trace = tracemessage;
00065 }
00066
00067 long Exception::getLineNo() const
00068 {
00069 return m_lineno;
00070 }
00071
|