diff -r f5050f1da672 -r 04becd199f91 javacommons/javastorage/inc/javastorageexception.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/javastorage/inc/javastorageexception.h Tue Apr 27 16:30:29 2010 +0300 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: JavaStorageException +* +*/ + + +#ifndef JAVASTORAGEEXCEPTION_H +#define JAVASTORAGEEXCEPTION_H + +#include "exceptionbase.h" +#include "javaosheaders.h" + +namespace java +{ +namespace storage +{ + +/** + * JavaStorage specific JavaStorageException. It is used to indicate + * JavaStorage related errors. + */ +class JavaStorageException : public java::util::ExceptionBase +{ +public: + JavaStorageException(int aStatus, + const std::string& aMessage, + const std::string& aFile, + const std::string& aMethod, + int aLine) + throw() : ExceptionBase(aMessage, + aFile, + aMethod, + aLine), mStatus(aStatus) {} + + virtual ~JavaStorageException() throw() {} + + /** + * Convert exception to string. + * + * @return exception as string. + */ + OS_IMPORT std::string toString() const throw(); + + JavaStorageException(const JavaStorageException& x) : ExceptionBase(x) + { + mStatus = x.mStatus; + } + int mStatus; + +private: + // Not implemented. + JavaStorageException& operator= (const JavaStorageException&); +}; + +enum StorageErrorCodes +{ + ECommsFailure = -100, + EInvalidStorage, + EInvalidConnection, + EInternalError, + EInvalidDataStructure, + EGeneralFailure, + EInvalidArgument +}; + + +} // end namespace storage +} // end namespace java + +#endif // JAVASTORAGEEXCEPTION_H