Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 1 | (* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | *) |
| 19 | |
| 20 | unit Thrift; |
| 21 | |
| 22 | interface |
| 23 | |
| 24 | uses |
Jens Geyer | 606f1ef | 2018-04-09 23:09:41 +0200 | [diff] [blame] | 25 | SysUtils, |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 26 | Thrift.Utils, |
Jens Geyer | 606f1ef | 2018-04-09 23:09:41 +0200 | [diff] [blame] | 27 | Thrift.Exception, |
| 28 | Thrift.Protocol; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 29 | |
| 30 | const |
Jens Geyer | 75cf93e | 2024-02-04 14:50:37 +0100 | [diff] [blame] | 31 | Version = '0.21.0'; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 32 | |
| 33 | type |
Jens Geyer | 606f1ef | 2018-04-09 23:09:41 +0200 | [diff] [blame] | 34 | TException = Thrift.Exception.TException; // compatibility alias |
| 35 | |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 36 | TApplicationExceptionSpecializedClass = class of TApplicationExceptionSpecialized; |
| 37 | |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 38 | TApplicationException = class( TException, IBase, ISupportsToString) |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 39 | public |
| 40 | type |
| 41 | {$SCOPEDENUMS ON} |
Jake Farrell | 7ae13e1 | 2011-10-18 14:35:26 +0000 | [diff] [blame] | 42 | TExceptionType = ( |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 43 | Unknown, |
| 44 | UnknownMethod, |
| 45 | InvalidMessageType, |
| 46 | WrongMethodName, |
| 47 | BadSequenceID, |
Roger Meier | 0193149 | 2012-12-22 21:31:03 +0100 | [diff] [blame] | 48 | MissingResult, |
| 49 | InternalError, |
| 50 | ProtocolError, |
| 51 | InvalidTransform, |
| 52 | InvalidProtocol, |
| 53 | UnsupportedClientType |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 54 | ); |
| 55 | {$SCOPEDENUMS OFF} |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 56 | strict private |
| 57 | FExceptionType : TExceptionType; |
| 58 | |
| 59 | strict protected |
| 60 | function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; |
| 61 | function _AddRef: Integer; stdcall; |
| 62 | function _Release: Integer; stdcall; |
| 63 | |
Jens Geyer | fad7fd3 | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 64 | strict protected |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 65 | constructor HiddenCreate(const Msg: string); |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 66 | class function GetSpecializedExceptionType(AType: TExceptionType): TApplicationExceptionSpecializedClass; |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 67 | |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 68 | public |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 69 | // purposefully hide inherited constructor |
| 70 | class function Create(const Msg: string): TApplicationException; overload; deprecated 'Use specialized TApplicationException types (or regenerate from IDL)'; |
| 71 | class function Create: TApplicationException; overload; deprecated 'Use specialized TApplicationException types (or regenerate from IDL)'; |
| 72 | class function Create( AType: TExceptionType): TApplicationException; overload; deprecated 'Use specialized TApplicationException types (or regenerate from IDL)'; |
| 73 | class function Create( AType: TExceptionType; const msg: string): TApplicationException; overload; deprecated 'Use specialized TApplicationException types (or regenerate from IDL)'; |
| 74 | |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 75 | function Type_: TExceptionType; virtual; |
| 76 | |
| 77 | procedure IBase_Read( const iprot: IProtocol); |
| 78 | procedure IBase.Read = IBase_Read; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 79 | |
Roger Meier | 333bbf3 | 2012-01-08 21:51:08 +0000 | [diff] [blame] | 80 | class function Read( const iprot: IProtocol): TApplicationException; |
| 81 | procedure Write( const oprot: IProtocol ); |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 82 | end; |
| 83 | |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 84 | // Needed to remove deprecation warning |
| 85 | TApplicationExceptionSpecialized = class abstract (TApplicationException) |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 86 | strict protected |
| 87 | class function GetType: TApplicationException.TExceptionType; virtual; abstract; |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 88 | public |
| 89 | constructor Create(const Msg: string); |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 90 | function Type_: TApplicationException.TExceptionType; override; |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 91 | end; |
| 92 | |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 93 | TApplicationExceptionUnknown = class (TApplicationExceptionSpecialized) |
Jens Geyer | fad7fd3 | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 94 | strict protected |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 95 | class function GetType: TApplicationException.TExceptionType; override; |
| 96 | end; |
| 97 | |
| 98 | TApplicationExceptionUnknownMethod = class (TApplicationExceptionSpecialized) |
Jens Geyer | fad7fd3 | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 99 | strict protected |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 100 | class function GetType: TApplicationException.TExceptionType; override; |
| 101 | end; |
| 102 | |
| 103 | TApplicationExceptionInvalidMessageType = class (TApplicationExceptionSpecialized) |
Jens Geyer | fad7fd3 | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 104 | strict protected |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 105 | class function GetType: TApplicationException.TExceptionType; override; |
| 106 | end; |
| 107 | |
| 108 | TApplicationExceptionWrongMethodName = class (TApplicationExceptionSpecialized) |
Jens Geyer | fad7fd3 | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 109 | strict protected |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 110 | class function GetType: TApplicationException.TExceptionType; override; |
| 111 | end; |
| 112 | |
| 113 | TApplicationExceptionBadSequenceID = class (TApplicationExceptionSpecialized) |
Jens Geyer | fad7fd3 | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 114 | strict protected |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 115 | class function GetType: TApplicationException.TExceptionType; override; |
| 116 | end; |
| 117 | |
| 118 | TApplicationExceptionMissingResult = class (TApplicationExceptionSpecialized) |
Jens Geyer | fad7fd3 | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 119 | strict protected |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 120 | class function GetType: TApplicationException.TExceptionType; override; |
| 121 | end; |
| 122 | |
| 123 | TApplicationExceptionInternalError = class (TApplicationExceptionSpecialized) |
Jens Geyer | fad7fd3 | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 124 | strict protected |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 125 | class function GetType: TApplicationException.TExceptionType; override; |
| 126 | end; |
| 127 | |
| 128 | TApplicationExceptionProtocolError = class (TApplicationExceptionSpecialized) |
Jens Geyer | fad7fd3 | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 129 | strict protected |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 130 | class function GetType: TApplicationException.TExceptionType; override; |
| 131 | end; |
| 132 | |
| 133 | TApplicationExceptionInvalidTransform = class (TApplicationExceptionSpecialized) |
Jens Geyer | fad7fd3 | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 134 | strict protected |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 135 | class function GetType: TApplicationException.TExceptionType; override; |
| 136 | end; |
| 137 | |
| 138 | TApplicationExceptionInvalidProtocol = class (TApplicationExceptionSpecialized) |
Jens Geyer | fad7fd3 | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 139 | strict protected |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 140 | class function GetType: TApplicationException.TExceptionType; override; |
| 141 | end; |
| 142 | |
| 143 | TApplicationExceptionUnsupportedClientType = class (TApplicationExceptionSpecialized) |
Jens Geyer | fad7fd3 | 2019-11-09 23:24:52 +0100 | [diff] [blame] | 144 | strict protected |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 145 | class function GetType: TApplicationException.TExceptionType; override; |
| 146 | end; |
| 147 | |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 148 | |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 149 | |
| 150 | implementation |
| 151 | |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 152 | { TApplicationException } |
| 153 | |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 154 | constructor TApplicationException.HiddenCreate(const Msg: string); |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 155 | begin |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 156 | inherited Create(Msg); |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 157 | end; |
| 158 | |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 159 | class function TApplicationException.Create(const Msg: string): TApplicationException; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 160 | begin |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 161 | Result := TApplicationExceptionUnknown.Create(Msg); |
| 162 | end; |
| 163 | |
| 164 | class function TApplicationException.Create: TApplicationException; |
| 165 | begin |
| 166 | Result := TApplicationExceptionUnknown.Create(''); |
| 167 | end; |
| 168 | |
| 169 | class function TApplicationException.Create( AType: TExceptionType): TApplicationException; |
| 170 | begin |
| 171 | {$WARN SYMBOL_DEPRECATED OFF} |
| 172 | Result := Create(AType, ''); |
| 173 | {$WARN SYMBOL_DEPRECATED DEFAULT} |
| 174 | end; |
| 175 | |
| 176 | class function TApplicationException.Create( AType: TExceptionType; const msg: string): TApplicationException; |
| 177 | begin |
| 178 | Result := GetSpecializedExceptionType(AType).Create(msg); |
| 179 | end; |
| 180 | |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 181 | |
| 182 | function TApplicationException.QueryInterface(const IID: TGUID; out Obj): HResult; |
| 183 | begin |
| 184 | if GetInterface(IID, Obj) |
| 185 | then result := S_OK |
| 186 | else result := E_NOINTERFACE; |
| 187 | end; |
| 188 | |
| 189 | function TApplicationException._AddRef: Integer; |
| 190 | begin |
| 191 | result := -1; // not refcounted |
| 192 | end; |
| 193 | |
| 194 | function TApplicationException._Release: Integer; |
| 195 | begin |
| 196 | result := -1; // not refcounted |
| 197 | end; |
| 198 | |
| 199 | |
| 200 | function TApplicationException.Type_: TExceptionType; |
| 201 | begin |
| 202 | result := FExceptionType; |
| 203 | end; |
| 204 | |
| 205 | |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 206 | class function TApplicationException.GetSpecializedExceptionType(AType: TExceptionType): TApplicationExceptionSpecializedClass; |
| 207 | begin |
| 208 | case AType of |
| 209 | TExceptionType.UnknownMethod: Result := TApplicationExceptionUnknownMethod; |
| 210 | TExceptionType.InvalidMessageType: Result := TApplicationExceptionInvalidMessageType; |
| 211 | TExceptionType.WrongMethodName: Result := TApplicationExceptionWrongMethodName; |
| 212 | TExceptionType.BadSequenceID: Result := TApplicationExceptionBadSequenceID; |
| 213 | TExceptionType.MissingResult: Result := TApplicationExceptionMissingResult; |
| 214 | TExceptionType.InternalError: Result := TApplicationExceptionInternalError; |
| 215 | TExceptionType.ProtocolError: Result := TApplicationExceptionProtocolError; |
| 216 | TExceptionType.InvalidTransform: Result := TApplicationExceptionInvalidTransform; |
| 217 | TExceptionType.InvalidProtocol: Result := TApplicationExceptionInvalidProtocol; |
| 218 | TExceptionType.UnsupportedClientType: Result := TApplicationExceptionUnsupportedClientType; |
| 219 | else |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 220 | ASSERT( TExceptionType.Unknown = aType); |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 221 | Result := TApplicationExceptionUnknown; |
| 222 | end; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 223 | end; |
| 224 | |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 225 | |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 226 | procedure TApplicationException.IBase_Read( const iprot: IProtocol); |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 227 | var |
Jens Geyer | 17c3ad9 | 2017-09-05 20:31:27 +0200 | [diff] [blame] | 228 | field : TThriftField; |
Jens Geyer | 17c3ad9 | 2017-09-05 20:31:27 +0200 | [diff] [blame] | 229 | struc : TThriftStruct; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 230 | begin |
Jens Geyer | beb9377 | 2014-01-23 19:16:52 +0100 | [diff] [blame] | 231 | struc := iprot.ReadStructBegin; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 232 | while ( True ) do |
| 233 | begin |
| 234 | field := iprot.ReadFieldBegin; |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 235 | if ( field.Type_ = TType.Stop) then begin |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 236 | Break; |
| 237 | end; |
| 238 | |
| 239 | case field.Id of |
| 240 | 1 : begin |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 241 | if ( field.Type_ = TType.String_) then begin |
| 242 | Exception(Self).Message := iprot.ReadString; |
| 243 | end else begin |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 244 | TProtocolUtil.Skip( iprot, field.Type_ ); |
| 245 | end; |
| 246 | end; |
| 247 | |
| 248 | 2 : begin |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 249 | if ( field.Type_ = TType.I32) then begin |
| 250 | FExceptionType := TExceptionType( iprot.ReadI32 ); |
| 251 | end else begin |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 252 | TProtocolUtil.Skip( iprot, field.Type_ ); |
| 253 | end; |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 254 | end else begin |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 255 | TProtocolUtil.Skip( iprot, field.Type_); |
| 256 | end; |
| 257 | end; |
| 258 | iprot.ReadFieldEnd; |
| 259 | end; |
| 260 | iprot.ReadStructEnd; |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 261 | end; |
| 262 | |
| 263 | |
| 264 | class function TApplicationException.Read( const iprot: IProtocol): TApplicationException; |
| 265 | var instance : TApplicationException; |
| 266 | base : IBase; |
| 267 | begin |
| 268 | instance := TApplicationException.CreateFmt('',[]); |
| 269 | try |
| 270 | if Supports( instance, IBase, base) then try |
| 271 | base.Read(iprot); |
| 272 | finally |
| 273 | base := nil; // clear ref before free |
| 274 | end; |
| 275 | |
| 276 | result := GetSpecializedExceptionType(instance.Type_).Create( Exception(instance).Message); |
| 277 | finally |
| 278 | instance.Free; |
| 279 | end; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 280 | end; |
| 281 | |
Roger Meier | 333bbf3 | 2012-01-08 21:51:08 +0000 | [diff] [blame] | 282 | procedure TApplicationException.Write( const oprot: IProtocol); |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 283 | var |
Jens Geyer | 17c3ad9 | 2017-09-05 20:31:27 +0200 | [diff] [blame] | 284 | struc : TThriftStruct; |
| 285 | field : TThriftField; |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 286 | begin |
Jens Geyer | 17c3ad9 | 2017-09-05 20:31:27 +0200 | [diff] [blame] | 287 | Init(struc, 'TApplicationException'); |
| 288 | Init(field); |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 289 | |
| 290 | oprot.WriteStructBegin( struc ); |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 291 | if Message <> '' then begin |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 292 | field.Name := 'message'; |
| 293 | field.Type_ := TType.String_; |
| 294 | field.Id := 1; |
| 295 | oprot.WriteFieldBegin( field ); |
| 296 | oprot.WriteString( Message ); |
| 297 | oprot.WriteFieldEnd; |
| 298 | end; |
| 299 | |
| 300 | field.Name := 'type'; |
| 301 | field.Type_ := TType.I32; |
| 302 | field.Id := 2; |
| 303 | oprot.WriteFieldBegin(field); |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 304 | oprot.WriteI32(Integer(Type_)); |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 305 | oprot.WriteFieldEnd(); |
| 306 | oprot.WriteFieldStop(); |
| 307 | oprot.WriteStructEnd(); |
| 308 | end; |
| 309 | |
Jens Geyer | e0e3240 | 2016-04-20 21:50:48 +0200 | [diff] [blame] | 310 | { TApplicationExceptionSpecialized } |
| 311 | |
| 312 | constructor TApplicationExceptionSpecialized.Create(const Msg: string); |
| 313 | begin |
| 314 | inherited HiddenCreate(Msg); |
| 315 | end; |
| 316 | |
Jens Geyer | e780855 | 2019-12-04 21:24:08 +0100 | [diff] [blame] | 317 | function TApplicationExceptionSpecialized.Type_: TApplicationException.TExceptionType; |
| 318 | begin |
| 319 | result := GetType; |
| 320 | end; |
| 321 | |
| 322 | |
Jens Geyer | 9f11c1e | 2019-11-09 19:39:20 +0100 | [diff] [blame] | 323 | { specialized TApplicationExceptions } |
| 324 | |
| 325 | class function TApplicationExceptionUnknownMethod.GetType : TApplicationException.TExceptionType; |
| 326 | begin |
| 327 | result := TExceptionType.UnknownMethod; |
| 328 | end; |
| 329 | |
| 330 | class function TApplicationExceptionInvalidMessageType.GetType : TApplicationException.TExceptionType; |
| 331 | begin |
| 332 | result := TExceptionType.InvalidMessageType; |
| 333 | end; |
| 334 | |
| 335 | class function TApplicationExceptionWrongMethodName.GetType : TApplicationException.TExceptionType; |
| 336 | begin |
| 337 | result := TExceptionType.WrongMethodName; |
| 338 | end; |
| 339 | |
| 340 | class function TApplicationExceptionBadSequenceID.GetType : TApplicationException.TExceptionType; |
| 341 | begin |
| 342 | result := TExceptionType.BadSequenceID; |
| 343 | end; |
| 344 | |
| 345 | class function TApplicationExceptionMissingResult.GetType : TApplicationException.TExceptionType; |
| 346 | begin |
| 347 | result := TExceptionType.MissingResult; |
| 348 | end; |
| 349 | |
| 350 | class function TApplicationExceptionInternalError.GetType : TApplicationException.TExceptionType; |
| 351 | begin |
| 352 | result := TExceptionType.InternalError; |
| 353 | end; |
| 354 | |
| 355 | class function TApplicationExceptionProtocolError.GetType : TApplicationException.TExceptionType; |
| 356 | begin |
| 357 | result := TExceptionType.ProtocolError; |
| 358 | end; |
| 359 | |
| 360 | class function TApplicationExceptionInvalidTransform.GetType : TApplicationException.TExceptionType; |
| 361 | begin |
| 362 | result := TExceptionType.InvalidTransform; |
| 363 | end; |
| 364 | |
| 365 | class function TApplicationExceptionInvalidProtocol.GetType : TApplicationException.TExceptionType; |
| 366 | begin |
| 367 | result := TExceptionType.InvalidProtocol; |
| 368 | end; |
| 369 | |
| 370 | class function TApplicationExceptionUnsupportedClientType.GetType : TApplicationException.TExceptionType; |
| 371 | begin |
| 372 | result := TExceptionType.UnsupportedClientType; |
| 373 | end; |
| 374 | |
| 375 | class function TApplicationExceptionUnknown.GetType : TApplicationException.TExceptionType; |
| 376 | begin |
| 377 | result := TExceptionType.Unknown; |
| 378 | end; |
| 379 | |
| 380 | |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 381 | end. |