Source for file OsidException.php

Documentation is available at OsidException.php

  1. <?php
  2. /**
  3. * OsidException or one of its subclasses is thrown by all methods of all
  4. * interfaces of an Open Service Interface Definition (OSID). This requires
  5. * the caller of an OSID package method handle the OsidException. Since the
  6. * application using an OSID can not determine where an implementation method
  7. * will ultimately execute, it must assume a worst case scenerio and protect
  8. * itself. OSID Implementations should throw their own subclasses of
  9. * OsidException and limit exception messages to those predefined by their own
  10. * OsidException or its superclasses. This approach to exception messages
  11. * allows Applications and OSID implementations using an OsidException's
  12. * predefined messages to handle exceptions in an interoperable way.
  13. *
  14. * <p>
  15. * OSID Version: 2.0
  16. * </p>
  17. *
  18. * <p>
  19. * Licensed under the {@link org.osid.SidImplementationLicenseMIT MIT}
  20. * O.K.I&#46; OSID Definition License}.
  21. * </p>
  22. *
  23. * @package org.osid
  24. */
  25. class OsidException
  26. {
  27. /**
  28. * Operation failed
  29. * Note: This method is PHP's equivalent of a static field.
  30. *
  31. * @return string
  32. * @access public
  33. * @static
  34. */
  35. function OPERATION_FAILED () {
  36. return "Operation failed ";
  37. }
  38.  
  39. /**
  40. * Null argument
  41. * Note: This method is PHP's equivalent of a static field.
  42. *
  43. * @return string
  44. * @access public
  45. * @static
  46. */
  47. function NULL_ARGUMENT () {
  48. return "Null argument";
  49. }
  50.  
  51. /**
  52. * Unimplemented method
  53. * Note: This method is PHP's equivalent of a static field.
  54. *
  55. * @return string
  56. * @access public
  57. * @static
  58. */
  59. function UNIMPLEMENTED () {
  60. return "Unimplemented method ";
  61. }
  62.  
  63. /**
  64. * OSID Version mismatch
  65. * Note: This method is PHP's equivalent of a static field.
  66. *
  67. * @return string
  68. * @access public
  69. * @static
  70. */
  71. function VERSION_ERROR () {
  72. return "OSID Version mismatch error ";
  73. }
  74.  
  75. /**
  76. * Transaction already marked
  77. * Note: This method is PHP's equivalent of a static field.
  78. *
  79. * @return string
  80. * @access public
  81. * @static
  82. */
  83. function ALREADY_MARKED () {
  84. return "Transaction already marked ";
  85. }
  86.  
  87. /**
  88. * No transaction marked
  89. * Note: This method is PHP's equivalent of a static field.
  90. *
  91. * @return string
  92. * @access public
  93. * @static
  94. */
  95. function NOTHING_MARKED () {
  96. return "No transaction marked ";
  97. }
  98.  
  99. /**
  100. * Interface not found
  101. * Note: This method is PHP's equivalent of a static field.
  102. *
  103. * @return string
  104. * @access public
  105. * @static
  106. */
  107. function INTERFACE_NOT_FOUND () {
  108. return "Interface not found ";
  109. }
  110.  
  111. /**
  112. * Manager not OSID implementation
  113. * Note: This method is PHP's equivalent of a static field.
  114. *
  115. * @return string
  116. * @access public
  117. * @static
  118. */
  119. function MANAGER_NOT_OSID_IMPLEMENTATION () {
  120. return "Manager not OSID implementation ";
  121. }
  122.  
  123. /**
  124. * Manager not found
  125. * Note: This method is PHP's equivalent of a static field.
  126. *
  127. * @return string
  128. * @access public
  129. * @static
  130. */
  131. function MANAGER_NOT_FOUND () {
  132. return "Manager not found ";
  133. }
  134.  
  135. /**
  136. * Manager instantiation error
  137. * Note: This method is PHP's equivalent of a static field.
  138. *
  139. * @return string
  140. * @access public
  141. * @static
  142. */
  143. function MANAGER_INSTANTIATION_ERROR () {
  144. return "Manager instantiation error ";
  145. }
  146.  
  147. /**
  148. * Error assigning context
  149. * Note: This method is PHP's equivalent of a static field.
  150. *
  151. * @return string
  152. * @access public
  153. * @static
  154. */
  155. function ERROR_ASSIGNING_CONTEXT () {
  156. return "Error assigning context ";
  157. }
  158.  
  159. /**
  160. * Error assigning configuration
  161. * Note: This method is PHP's equivalent of a static field.
  162. *
  163. * @return string
  164. * @access public
  165. * @static
  166. */
  167. function ERROR_ASSIGNING_CONFIGURATION () {
  168. return "Error assigning configuration ";
  169. }
  170.  
  171. /**
  172. * Permission denied
  173. * Note: This method is PHP's equivalent of a static field.
  174. *
  175. * @return string
  176. * @access public
  177. * @static
  178. */
  179. function PERMISSION_DENIED () {
  180. return "Permission denied";
  181. }
  182.  
  183. /**
  184. * Configuration error
  185. * Note: This method is PHP's equivalent of a static field.
  186. *
  187. * @return string
  188. * @access public
  189. * @static
  190. */
  191. function CONFIGURATION_ERROR () {
  192. return "Configuration error";
  193. }
  194.  
  195.  
  196. function OsidException ( $message ) {
  197. die($message);
  198. }
  199.  
  200. }
  201.  
  202. ?>

Documentation generated on Wed, 19 Sep 2007 10:25:24 -0400 by phpDocumentor 1.3.0RC3