1 | <?php |
||
26 | class WosServerException extends WosException |
||
27 | { |
||
28 | const UNKNOWN_NAME = 'UNKNOWN'; |
||
29 | const UNKNOWN_MEANING = 'Unknown or undocumented WOS error code returned'; |
||
30 | |||
31 | /** |
||
32 | * Code Names Map |
||
33 | * |
||
34 | * @var array|string[] |
||
35 | */ |
||
36 | private static $codeNames = [ |
||
37 | 200 => 'NoNodeForPolicy', |
||
38 | 201 => 'NoNodeForObject', |
||
39 | 202 => 'UnknownPolicyName', |
||
40 | 203 => 'InternalError', |
||
41 | 205 => 'InvalidObjId', |
||
42 | 206 => 'NoSpace', |
||
43 | 207 => 'ObjNotFound', |
||
44 | 208 => 'ObjCorrupted', |
||
45 | 209 => 'FsCorrupted', |
||
46 | 210 => 'PolicyNotSupported', |
||
47 | 211 => 'IOErr', |
||
48 | 212 => 'InvalidObjectSize', |
||
49 | 214 => 'TemporarilyNotSupported', |
||
50 | 216 => 'ReservationNotFound', |
||
51 | 217 => 'EmptyObject', |
||
52 | 218 => 'InvalidMetadataKey', |
||
53 | 219 => 'UnusedReservation', |
||
54 | 220 => 'WireCorruption', |
||
55 | 221 => 'CommandTimeout', |
||
56 | 222 => 'InvalidGetSpan' |
||
57 | ]; |
||
58 | |||
59 | /** |
||
60 | * Code Meanings Map |
||
61 | * |
||
62 | * @var array|string[] |
||
63 | */ |
||
64 | private static $codeMeanings = [ |
||
65 | 200 => 'No nodes will accept Put or Reserve operations for this policy', |
||
66 | 201 => 'No nodes have a copy of the requested object', |
||
67 | 202 => 'Policy name or id is not currently supported by the cluster', |
||
68 | 203 => 'Unknown internal Error', |
||
69 | 205 => 'An invalid OID was specified', |
||
70 | 206 => 'The cluster is full', |
||
71 | 207 => 'Object cannot be located', |
||
72 | 208 => 'Object does not match its checksum', |
||
73 | 209 => 'Filesystem internal structures are corrupted', |
||
74 | 210 => 'Insufficient cluster resources to service Put or Reserve request for this policy', |
||
75 | 211 => 'Unrecoverable drive error', |
||
76 | 212 => '> 5 TB', |
||
77 | 214 => 'Operation should be retried momentarily', |
||
78 | 216 => 'Reservation not found for specified OID', |
||
79 | 217 => 'Attempt to store a zero-length object', |
||
80 | 218 => 'Invalid metadata key specified', |
||
81 | 219 => 'Attempted Get of an unused reservation', |
||
82 | 220 => 'Uncorrectable network corruption of the object', |
||
83 | 221 => 'Command did not complete in a timely manner', |
||
84 | 222 => 'Illegal combination of buffered=true, integity=false' |
||
85 | ]; |
||
86 | |||
87 | // --------------------------------------------------------------- |
||
88 | |||
89 | /** |
||
90 | * WosServerException constructor. |
||
91 | * |
||
92 | * @param string $code |
||
93 | * @param string $message |
||
94 | * @param \Exception $previous |
||
95 | */ |
||
96 | public function __construct($code, $message = '', \Exception $previous = null) |
||
113 | |||
114 | /** |
||
115 | * Get DDN error name |
||
116 | * |
||
117 | * @return string |
||
118 | */ |
||
119 | public function getErrorName() |
||
125 | |||
126 | /** |
||
127 | * Get the DDN error meaning |
||
128 | * |
||
129 | * @return string |
||
130 | */ |
||
131 | public function getErrorMeaning() |
||
137 | |||
138 | /** |
||
139 | * @return string |
||
140 | */ |
||
141 | public function __toString() |
||
145 | } |
||
146 |
Let’s assume you have a class which uses late-static binding:
The code above will run fine in your PHP runtime. However, if you now create a sub-class and call the
getSomeVariable()
on that sub-class, you will receive a runtime error:In the case above, it makes sense to update
SomeClass
to useself
instead: