IdException.pas 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. {
  2. $Project$
  3. $Workfile$
  4. $Revision$
  5. $DateUTC$
  6. $Id$
  7. This file is part of the Indy (Internet Direct) project, and is offered
  8. under the dual-licensing agreement described on the Indy website.
  9. (http://www.indyproject.org/)
  10. Copyright:
  11. (c) 1993-2005, Chad Z. Hower and the Indy Pit Crew. All rights reserved.
  12. }
  13. {
  14. $Log$
  15. }
  16. {
  17. Rev 1.5 09/06/2004 09:52:52 CCostelloe
  18. Kylix 3 patch
  19. Rev 1.4 2004.04.18 4:38:24 PM czhower
  20. EIdExceptionBase created
  21. Rev 1.3 2004.03.07 11:45:22 AM czhower
  22. Flushbuffer fix + other minor ones found
  23. Rev 1.2 2/10/2004 7:33:24 PM JPMugaas
  24. I had to move the wrapper exception here for DotNET stack because Borland's
  25. update 1 does not permit unlisted units from being put into a package. That
  26. now would report an error and I didn't want to move IdExceptionCore into the
  27. System package.
  28. Rev 1.1 2004.02.03 3:15:52 PM czhower
  29. Updates to move to System.
  30. Rev 1.0 2004.02.03 2:36:00 PM czhower
  31. Move
  32. }
  33. unit IdException;
  34. interface
  35. {$I IdCompilerDefines.inc}
  36. uses
  37. SysUtils;
  38. type
  39. // EIdException is the base class for all Exceptions raised in the Indy library.
  40. EIdException = class(Exception)
  41. public
  42. {
  43. The constructor must be virtual for Delphi NET if you want to call it with class methods.
  44. Otherwise, it will not compile in that IDE. Also it's overloaded so that it doesn't close
  45. the other methods declared by the DotNet exception (particularly InnerException constructors)
  46. }
  47. constructor Create(const AMsg: string); overload; virtual;
  48. end;
  49. TClassIdException = class of EIdException;
  50. // You can add EIdSilentException to the list of ignored exceptions to reduce debugger "trapping"
  51. // of "normal" exceptions
  52. EIdSilentException = class(EIdException);
  53. // EIdConnClosedGracefully is raised when remote side closes connection normally
  54. EIdConnClosedGracefully = class(EIdSilentException);
  55. //used for index out of range
  56. {CH EIdRangeException = class(EIdException); }
  57. // Other shared exceptions
  58. EIdSocketHandleError = class(EIdException);
  59. {$IFDEF UNIX}
  60. EIdNonBlockingNotSupported = class(EIdException);
  61. {$ENDIF}
  62. EIdPackageSizeTooBig = class(EIdSocketHandleError);
  63. EIdNotAllBytesSent = class (EIdSocketHandleError);
  64. EIdCouldNotBindSocket = class (EIdSocketHandleError);
  65. EIdCanNotBindPortInRange = class (EIdSocketHandleError);
  66. EIdInvalidPortRange = class(EIdSocketHandleError);
  67. EIdCannotSetIPVersionWhenConnected = class(EIdSocketHandleError);
  68. {CH EIdInvalidIPAddress = class(EIdSocketHandleError); }
  69. implementation
  70. { EIdException }
  71. constructor EIdException.Create(const AMsg : String);
  72. begin
  73. inherited Create(AMsg);
  74. end;
  75. end.