00001 /* 00002 * $Id: Exception.h,v 1.25 2003/09/12 22:23:51 mindstorm2600 Exp $ 00003 * 00004 * This is the main class for exception treatment, this section 00005 * is going to be completely rewritten 00006 * 00007 */ 00008 #ifndef __CLAW_EXCEPTION_H__ 00009 #define __CLAW_EXCEPTION_H__ 00010 #include<Object.h> 00011 00012 namespace clawsoft{ 00013 00017 class Exception:public Object{ 00018 private: 00019 protected: 00023 char *description; 00024 public: 00028 Exception(); 00033 Exception(const char *d); 00037 const char *toString(); 00038 }; 00039 00042 class InvalidParameterException:public Exception{ 00043 public: 00047 InvalidParameterException(); 00048 }; 00049 00054 class ArrayIndexOutOfLimitsException:public Exception{ 00055 public: 00059 ArrayIndexOutOfLimitsException(); 00060 }; 00061 00066 class NullPointerException:public Exception{ 00067 public: 00071 NullPointerException(); 00072 }; 00073 00078 class NumberException:public Exception{ 00079 public: 00083 NumberException(); 00084 }; 00085 00090 class ElementNotFoundException:public Exception{ 00091 public: 00095 ElementNotFoundException(); 00096 }; 00097 00098 00103 class NoMoreTokensException:public Exception{ 00104 public: 00108 NoMoreTokensException(); 00109 }; 00110 00111 00113 00117 class MutexException:public Exception{ 00118 public: 00122 MutexException(); 00123 }; 00124 00128 class DeadLockException:public MutexException{ 00129 public: 00133 DeadLockException(); 00134 }; 00135 00139 class UnableToLockMutexException:public MutexException{ 00140 public: 00144 UnableToLockMutexException(); 00145 }; 00146 00150 class UnableToUnlockMutexException:public MutexException{ 00151 public: 00155 UnableToUnlockMutexException(); 00156 }; 00157 00158 00160 00162 class NetworkException:public Exception{ 00163 public: 00167 NetworkException(); 00168 }; 00169 00171 class ConnectionTimeoutException:public NetworkException{ 00172 public: 00176 ConnectionTimeoutException(); 00177 }; 00178 00181 class ConnectionRefusedException:public NetworkException{ 00182 public: 00186 ConnectionRefusedException(); 00187 }; 00188 00191 class NetworkUnreachableException:public NetworkException{ 00192 public: 00196 NetworkUnreachableException(); 00197 }; 00198 00201 class SocketAlreadyBoundedException:public NetworkException{ 00202 public: 00203 SocketAlreadyBoundedException(); 00204 }; 00205 00207 class SocketAlreadyUsedException:public NetworkException{ 00208 public: 00209 SocketAlreadyUsedException(); 00210 }; 00211 00215 class SecurityException:public Exception{ 00216 public: 00220 SecurityException(); 00221 }; 00222 00226 class UserIDDoesNotMatchException:public SecurityException{ 00227 public: 00231 UserIDDoesNotMatchException(); 00232 }; 00233 00235 00238 class IOException:public Exception{ 00239 public: 00243 IOException(); 00244 }; 00245 00251 class BrokenPipeException:public IOException{ 00252 public: 00256 BrokenPipeException(); 00257 }; 00258 00262 class ProcOutOfFileDescriptorsException:public IOException{ 00263 public: 00267 ProcOutOfFileDescriptorsException(); 00268 }; 00269 00273 class SysOutOfFileDescriptorsException:public IOException{ 00274 public: 00278 SysOutOfFileDescriptorsException(); 00279 }; 00280 00285 class SocketUnableToWriteException:public IOException{ 00286 public: 00290 SocketUnableToWriteException(); 00291 }; 00292 00297 class SocketUnableToReadException:public IOException{ 00298 public: 00302 SocketUnableToReadException(); 00303 }; 00304 00309 class FileException:public IOException{ 00310 public: 00314 FileException(); 00315 }; 00316 00320 class FileExistsException:public FileException{ 00321 public: 00325 FileExistsException(); 00326 }; 00330 class FeatureNotAvailableOnPipesOrSocketException:public FileException{ 00331 public: 00335 FeatureNotAvailableOnPipesOrSocketException(); 00336 }; 00337 00342 class ThisIsADirectoryException:public FileException{ 00343 public: 00347 ThisIsADirectoryException(); 00348 }; 00353 class PermissionDeniedException:public FileException{ 00354 public: 00358 PermissionDeniedException(); 00359 }; 00364 class FilenameTooLongException:public FileException{ 00365 public: 00369 FilenameTooLongException(); 00370 }; 00375 class FileOrDirectoryNotFoundException:public FileException{ 00376 public: 00380 FileOrDirectoryNotFoundException(); 00381 }; 00386 class ThisIsNotADirectoryException:public FileException{ 00387 public: 00391 ThisIsNotADirectoryException(); 00392 }; 00397 class FileNotOpenedException:public FileException{ 00398 public: 00402 FileNotOpenedException(); 00403 }; 00410 class DeviceOrFIFONotFoundException:public IOException{ 00411 public: 00415 DeviceOrFIFONotFoundException(); 00416 }; 00422 class DeviceNotFoundException:public IOException{ 00423 public: 00427 DeviceNotFoundException(); 00428 }; 00433 class UnableToWriteOnReadOnlyFileException:public FileException{ 00434 public: 00438 UnableToWriteOnReadOnlyFileException(); 00439 }; 00444 class UnableToWriteOnRunningExecutableFileException:public FileException{ 00445 public: 00449 UnableToWriteOnRunningExecutableFileException(); 00450 }; 00455 class FilenameExceedsAddressSpaceException:public FileException{ 00456 public: 00460 FilenameExceedsAddressSpaceException(); 00461 }; 00466 class TooManySymlinksException:public FileException{ 00467 public: 00471 TooManySymlinksException(); 00472 }; 00477 class NotEnoughStorageSpaceException:public FileException{ 00478 public: 00482 NotEnoughStorageSpaceException(); 00483 }; 00488 class NotEnoughKernelMemoryException:public IOException{ 00489 public: 00493 NotEnoughKernelMemoryException(); 00494 }; 00499 class MaximumNumberOfOpenFilesForThisProcessException:public FileException{ 00500 public: 00504 MaximumNumberOfOpenFilesForThisProcessException(); 00505 }; 00510 class MaximumNumberOfOpenFilesForThisSystemException:public FileException{ 00511 public: 00515 MaximumNumberOfOpenFilesForThisSystemException(); 00516 }; 00517 00518 00520 00521 00522 00526 class DSOException:public IOException{ 00527 public: 00531 DSOException(const char *msg = 0); 00532 }; 00533 00538 class CantLoadDSOException:public DSOException{ 00539 public: 00543 CantLoadDSOException(); 00544 00545 }; 00546 00550 class CantUnloadDSOException:public DSOException{ 00551 public: 00555 CantUnloadDSOException(); 00556 00557 }; 00558 00563 class DSOSymbolException:public DSOException{ 00564 public: 00568 DSOSymbolException(); 00569 }; 00570 00574 class ThreadException:public Exception{ 00575 public: 00579 ThreadException(); 00580 }; 00581 00586 class ThreadNotRunningException:public ThreadException{ 00587 public: 00591 ThreadNotRunningException(); 00592 }; 00593 00595 class FileTooBigException:public FileException{ 00596 public: 00600 FileTooBigException(); 00601 }; 00602 00603 00604 00606 class WriteWillBlockException:public FileException{ 00607 public: 00611 WriteWillBlockException(); 00612 }; 00613 00614 00616 class InterruptedSystemCallException:public IOException{ 00617 public: 00621 InterruptedSystemCallException(); 00622 }; 00623 00624 00626 class MemoryException:public Exception{ 00627 public: 00631 MemoryException(); 00632 }; 00633 00634 00636 class AllocationFailedException:public MemoryException{ 00637 public: 00641 AllocationFailedException(); 00642 }; 00643 00644 00646 class ReallocFailedException:public MemoryException{ 00647 public: 00651 ReallocFailedException(); 00652 }; 00653 00654 00656 class MathException:public Exception{ 00657 public: 00661 MathException(); 00662 }; 00663 00664 00666 class BufferTooSmallException:public Exception{ 00667 public: 00671 BufferTooSmallException(); 00672 }; 00673 00674 00676 class GroupException:public Exception{ 00677 public: 00681 GroupException(); 00682 }; 00683 00684 00686 class UserException:public Exception{ 00687 public: 00691 UserException(); 00692 }; 00693 00694 00696 class UserNotFoundException:public UserException{ 00697 public: 00701 UserNotFoundException(); 00702 }; 00703 00704 00706 class GroupNotFoundException:public GroupException{ 00707 public: 00711 GroupNotFoundException(); 00712 }; 00713 00714 00716 class ConditionVarWaitTimedOutException:public ThreadException{ 00717 public: 00721 ConditionVarWaitTimedOutException(); 00722 }; 00723 00724 00726 class SemaphoreException:public ThreadException{ 00727 public: 00731 SemaphoreException(); 00732 }; 00733 00734 00736 class SemaphoreInitValueException:public SemaphoreException{ 00737 public: 00741 SemaphoreInitValueException(); 00742 }; 00743 00744 00746 class SemaphoreUnableToDestroyException:public SemaphoreException{ 00747 public: 00751 SemaphoreUnableToDestroyException(); 00752 }; 00753 00754 00756 class SemaphoreUnableToDecreaseException:public SemaphoreException{ 00757 public: 00761 SemaphoreUnableToDecreaseException(); 00762 }; 00763 00764 00766 class SemaphoreUnableToIncreaseException:public SemaphoreException{ 00767 public: 00771 SemaphoreUnableToIncreaseException(); 00772 }; 00773 00774 00776 class FileNotFoundException:public FileException{ 00777 public: 00781 FileNotFoundException(); 00782 }; 00783 00784 00786 class DatabaseException:public Exception{ 00787 public: 00791 DatabaseException(); 00792 }; 00793 00794 00796 class DBServerUnreachableException:public DatabaseException{ 00797 public: 00801 DBServerUnreachableException(); 00802 }; 00803 00804 00806 class AlreadyConnected2DBException:public DatabaseException{ 00807 public: 00811 AlreadyConnected2DBException(); 00812 }; 00813 00814 00816 class DBConnectFirstException:public DatabaseException{ 00817 public: 00821 DBConnectFirstException(); 00822 }; 00823 00824 00826 class UndefinedClassException:public Exception{ 00827 public: 00831 UndefinedClassException(); 00832 }; 00833 00834 00836 class StringException:public Exception{ 00837 public: 00841 StringException(); 00842 }; 00843 00844 00846 class ParseException:public Exception{ 00847 public: 00851 ParseException(); 00852 }; 00853 00854 00856 class DateParseException:public ParseException{ 00857 public: 00861 DateParseException(); 00862 }; 00863 00864 00866 class TimeParseException:public ParseException{ 00867 public: 00871 TimeParseException(); 00872 }; 00873 00874 00876 class BitParseException:public ParseException{ 00877 public: 00881 BitParseException(); 00882 }; 00883 00884 00886 class ByteParseException:public ParseException{ 00887 public: 00891 ByteParseException(); 00892 }; 00893 00894 00896 class NoDataFetchException:public DatabaseException{ 00897 public: 00901 NoDataFetchException(); 00902 }; 00903 00904 00906 class NoMoreRowsException:public DatabaseException{ 00907 public: 00911 NoMoreRowsException(); 00912 }; 00913 00914 00916 class DBConnectionFailedException:public DatabaseException{ 00917 public: 00921 DBConnectionFailedException(); 00922 }; 00923 00924 }; 00925 #endif 00926
Authors:
Juan V. Guerrero
Jannette C. Mejia
Juan C. Guevara
Powered by: