| 1 |
(* ***** BEGIN LICENSE BLOCK ***** |
| 2 |
* Version: MPL 1.1 |
| 3 |
* |
| 4 |
* The contents of this file are subject to the Mozilla Public License Version |
| 5 |
* 1.1 (the "License"); you may not use this file except in compliance with |
| 6 |
* the License. You may obtain a copy of the License at |
| 7 |
* http://www.mozilla.org/MPL/ |
| 8 |
* |
| 9 |
* Software distributed under the License is distributed on an "AS IS" basis, |
| 10 |
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
| 11 |
* for the specific language governing rights and limitations under the |
| 12 |
* License. |
| 13 |
* |
| 14 |
* The Original Code is TurboPower Abbrevia |
| 15 |
* |
| 16 |
* The Initial Developer of the Original Code is |
| 17 |
* TurboPower Software |
| 18 |
* |
| 19 |
* Portions created by the Initial Developer are Copyright (C) 1997-2002 |
| 20 |
* the Initial Developer. All Rights Reserved. |
| 21 |
* |
| 22 |
* Contributor(s): |
| 23 |
* |
| 24 |
* ***** END LICENSE BLOCK ***** *) |
| 25 |
|
| 26 |
{*********************************************************} |
| 27 |
{* ABBREVIA: AbExcept.pas *} |
| 28 |
{*********************************************************} |
| 29 |
{* ABBREVIA: Exception classes *} |
| 30 |
{*********************************************************} |
| 31 |
|
| 32 |
unit AbExcept; |
| 33 |
|
| 34 |
{$I AbDefine.inc} |
| 35 |
|
| 36 |
interface |
| 37 |
|
| 38 |
uses |
| 39 |
SysUtils, |
| 40 |
AbUtils; |
| 41 |
|
| 42 |
type |
| 43 |
EAbException = class( Exception ) |
| 44 |
public |
| 45 |
ErrorCode : Integer; |
| 46 |
end; |
| 47 |
|
| 48 |
EAbArchiveBusy = class( EAbException ) |
| 49 |
public |
| 50 |
constructor Create; |
| 51 |
end; |
| 52 |
|
| 53 |
EAbBadStream = class( EAbException ) |
| 54 |
protected |
| 55 |
FInnerException : Exception; |
| 56 |
public |
| 57 |
constructor Create; |
| 58 |
constructor CreateInner(aInnerException : Exception); |
| 59 |
property InnerException : Exception read FInnerException; |
| 60 |
end; |
| 61 |
|
| 62 |
EAbDuplicateName = class( EAbException ) |
| 63 |
public |
| 64 |
constructor Create; |
| 65 |
end; |
| 66 |
|
| 67 |
EAbFileNotFound = class( EAbException ) |
| 68 |
public |
| 69 |
constructor Create; |
| 70 |
end; |
| 71 |
|
| 72 |
EAbNoArchive = class( EAbException ) |
| 73 |
public |
| 74 |
constructor Create; |
| 75 |
end; |
| 76 |
|
| 77 |
EAbUserAbort = class( EAbException ) |
| 78 |
public |
| 79 |
constructor Create; |
| 80 |
end; |
| 81 |
|
| 82 |
EAbNoSuchDirectory = class( EAbException ) |
| 83 |
public |
| 84 |
constructor Create; |
| 85 |
end; |
| 86 |
|
| 87 |
EAbUnhandledType = class( EAbException ) |
| 88 |
public |
| 89 |
constructor Create; |
| 90 |
end; |
| 91 |
|
| 92 |
EAbSpanningNotSupported = class (EAbException) |
| 93 |
public |
| 94 |
constructor Create; |
| 95 |
end; |
| 96 |
|
| 97 |
EAbInvalidSpanningThreshold = class ( EAbException ) |
| 98 |
public |
| 99 |
constructor Create; |
| 100 |
end; |
| 101 |
|
| 102 |
EAbZipException = class( EAbException ); {Zip exception} |
| 103 |
EAbCabException = class( EAbException ); {Cab exception} |
| 104 |
EAbTarException = class( EAbException ); {Tar Exception} |
| 105 |
EAbGzipException = class( EAbException); {GZip exception} |
| 106 |
|
| 107 |
EAbZipBadSpanStream = class( EAbZipException ) |
| 108 |
public |
| 109 |
constructor Create; |
| 110 |
end; |
| 111 |
|
| 112 |
EAbZipBadCRC = class( EAbZipException ) |
| 113 |
public |
| 114 |
constructor Create; |
| 115 |
end; |
| 116 |
|
| 117 |
EAbZipInflateBlock = class( EAbZipException ) |
| 118 |
public |
| 119 |
constructor Create; |
| 120 |
end; |
| 121 |
|
| 122 |
EAbZipInvalid = class( EAbZipException ) |
| 123 |
public |
| 124 |
constructor Create; |
| 125 |
end; |
| 126 |
|
| 127 |
EAbInvalidIndex = class( EAbZipException ) |
| 128 |
public |
| 129 |
constructor Create; |
| 130 |
end; |
| 131 |
|
| 132 |
EAbZipInvalidFactor = class( EAbZipException ) |
| 133 |
public |
| 134 |
constructor Create; |
| 135 |
end; |
| 136 |
|
| 137 |
EAbZipInvalidLFH = class( EAbZipException ) |
| 138 |
public |
| 139 |
constructor Create; |
| 140 |
end; |
| 141 |
|
| 142 |
EAbZipInvalidMethod = class( EAbZipException ) |
| 143 |
public |
| 144 |
constructor Create; |
| 145 |
end; |
| 146 |
|
| 147 |
EAbZipInvalidPassword = class( EAbZipException ) |
| 148 |
public |
| 149 |
constructor Create; |
| 150 |
end; |
| 151 |
|
| 152 |
EAbZipInvalidStub= class( EAbZipException ) |
| 153 |
public |
| 154 |
constructor Create; |
| 155 |
end; |
| 156 |
|
| 157 |
EAbZipNoExtraction = class( EAbZipException ) |
| 158 |
public |
| 159 |
constructor Create; |
| 160 |
end; |
| 161 |
|
| 162 |
EAbZipNoInsertion = class( EAbZipException ) |
| 163 |
public |
| 164 |
constructor Create; |
| 165 |
end; |
| 166 |
|
| 167 |
EAbZipSpanOverwrite= class( EAbZipException ) |
| 168 |
public |
| 169 |
constructor Create; |
| 170 |
end; |
| 171 |
|
| 172 |
EAbZipStreamFull = class( EAbZipException ) |
| 173 |
public |
| 174 |
constructor Create; |
| 175 |
end; |
| 176 |
|
| 177 |
EAbZipTruncate = class( EAbZipException ) |
| 178 |
public |
| 179 |
constructor Create; |
| 180 |
end; |
| 181 |
|
| 182 |
EAbZipUnsupported = class( EAbZipException ) |
| 183 |
public |
| 184 |
constructor Create; |
| 185 |
end; |
| 186 |
|
| 187 |
EAbZipVersion = class( EAbZipException ) |
| 188 |
public |
| 189 |
constructor Create; |
| 190 |
end; |
| 191 |
|
| 192 |
EAbReadError = class( EAbZipException ) |
| 193 |
public |
| 194 |
constructor Create; |
| 195 |
end; |
| 196 |
|
| 197 |
EAbGzipBadCRC = class( EAbGZipException ) |
| 198 |
public |
| 199 |
constructor Create; |
| 200 |
end; |
| 201 |
|
| 202 |
EAbGzipBadFileSize = class( EAbGZipException ) |
| 203 |
public |
| 204 |
constructor Create; |
| 205 |
end; |
| 206 |
|
| 207 |
EAbGzipInvalid = class( EAbGZipException ) |
| 208 |
public |
| 209 |
constructor Create; |
| 210 |
end; |
| 211 |
|
| 212 |
EAbTarInvalid = class( EAbTarException) |
| 213 |
public |
| 214 |
constructor Create; |
| 215 |
end; |
| 216 |
|
| 217 |
EAbTarBadFileName = class( EAbTarException) |
| 218 |
public |
| 219 |
constructor Create; |
| 220 |
end; |
| 221 |
|
| 222 |
EAbTarBadLinkName = class( EAbTarException) |
| 223 |
public |
| 224 |
constructor Create; |
| 225 |
end; |
| 226 |
|
| 227 |
EAbTarBadOp = class( EAbTarException) |
| 228 |
public |
| 229 |
constructor Create; |
| 230 |
end; |
| 231 |
|
| 232 |
EAbVMSInvalidOrigin = class( EAbZipException ) |
| 233 |
public |
| 234 |
constructor Create( Value : Integer ); |
| 235 |
end; |
| 236 |
|
| 237 |
EAbVMSErrorOpenSwap = class( EAbZipException ) |
| 238 |
public |
| 239 |
constructor Create( const Value : string ); |
| 240 |
end; |
| 241 |
|
| 242 |
EAbVMSSeekFail = class( EAbZipException ) |
| 243 |
public |
| 244 |
constructor Create( const Value : string ); |
| 245 |
end; |
| 246 |
|
| 247 |
EAbVMSReadFail = class( EAbZipException ) |
| 248 |
public |
| 249 |
constructor Create( Count : Integer; const Value : string ); |
| 250 |
end; |
| 251 |
|
| 252 |
EAbVMSWriteFail = class( EAbZipException ) |
| 253 |
public |
| 254 |
constructor Create( Count : Integer; const Value : string ); |
| 255 |
end; |
| 256 |
|
| 257 |
EAbVMSWriteTooManyBytes = class( EAbZipException ) |
| 258 |
public |
| 259 |
constructor Create( Count : Integer ); |
| 260 |
end; |
| 261 |
|
| 262 |
EAbBBSReadTooManyBytes = class( EAbZipException ) |
| 263 |
public |
| 264 |
constructor Create(Count : Integer ); |
| 265 |
end; |
| 266 |
|
| 267 |
EAbBBSSeekOutsideBuffer = class( EAbZipException ) |
| 268 |
public |
| 269 |
constructor Create; |
| 270 |
end; |
| 271 |
|
| 272 |
EAbBBSInvalidOrigin = class( EAbZipException ) |
| 273 |
public |
| 274 |
constructor Create; |
| 275 |
end; |
| 276 |
|
| 277 |
EAbBBSWriteTooManyBytes = class( EAbZipException ) |
| 278 |
public |
| 279 |
constructor Create(Count : Integer ); |
| 280 |
end; |
| 281 |
|
| 282 |
EAbSWSNotEndofStream = class( EAbZipException ) |
| 283 |
public |
| 284 |
constructor Create; |
| 285 |
end; |
| 286 |
|
| 287 |
EAbSWSSeekFailed = class( EAbZipException ) |
| 288 |
public |
| 289 |
constructor Create; |
| 290 |
end; |
| 291 |
|
| 292 |
EAbSWSWriteFailed = class( EAbZipException ) |
| 293 |
public |
| 294 |
constructor Create; |
| 295 |
end; |
| 296 |
|
| 297 |
EAbSWSInvalidOrigin = class( EAbZipException ) |
| 298 |
public |
| 299 |
constructor Create; |
| 300 |
end; |
| 301 |
|
| 302 |
EAbSWSInvalidNewOrigin = class( EAbZipException ) |
| 303 |
public |
| 304 |
constructor Create; |
| 305 |
end; |
| 306 |
|
| 307 |
EAbNoCabinetDll = class( EAbCabException ) |
| 308 |
public |
| 309 |
constructor Create; |
| 310 |
end; |
| 311 |
|
| 312 |
EAbFCIFileOpenError = class( EAbCabException ) |
| 313 |
public |
| 314 |
constructor Create; |
| 315 |
end; |
| 316 |
|
| 317 |
EAbFCIFileReadError = class( EAbCabException ) |
| 318 |
public |
| 319 |
constructor Create; |
| 320 |
end; |
| 321 |
|
| 322 |
EAbFCIFileWriteError = class( EAbCabException ) |
| 323 |
public |
| 324 |
constructor Create; |
| 325 |
end; |
| 326 |
|
| 327 |
EAbFCIFileCloseError = class( EAbCabException ) |
| 328 |
public |
| 329 |
constructor Create; |
| 330 |
end; |
| 331 |
|
| 332 |
EAbFCIFileSeekError = class( EAbCabException ) |
| 333 |
public |
| 334 |
constructor Create; |
| 335 |
end; |
| 336 |
|
| 337 |
EAbFCIFileDeleteError = class( EAbCabException ) |
| 338 |
public |
| 339 |
constructor Create; |
| 340 |
end; |
| 341 |
|
| 342 |
EAbFCIAddFileError = class( EAbCabException ) |
| 343 |
public |
| 344 |
constructor Create; |
| 345 |
end; |
| 346 |
|
| 347 |
EAbFCICreateError = class( EAbCabException ) |
| 348 |
public |
| 349 |
constructor Create; |
| 350 |
end; |
| 351 |
|
| 352 |
EAbFCIFlushCabinetError = class( EAbCabException ) |
| 353 |
public |
| 354 |
constructor Create; |
| 355 |
end; |
| 356 |
|
| 357 |
EAbFCIFlushFolderError = class( EAbCabException ) |
| 358 |
public |
| 359 |
constructor Create; |
| 360 |
end; |
| 361 |
|
| 362 |
EAbFDICopyError = class( EAbCabException ) |
| 363 |
public |
| 364 |
constructor Create; |
| 365 |
end; |
| 366 |
|
| 367 |
EAbFDICreateError = class( EAbCabException ) |
| 368 |
public |
| 369 |
constructor Create; |
| 370 |
end; |
| 371 |
|
| 372 |
EAbInvalidCabTemplate = class( EAbCabException ) |
| 373 |
public |
| 374 |
constructor Create; |
| 375 |
end; |
| 376 |
|
| 377 |
EAbInvalidCabFile = class( EAbCabException ) |
| 378 |
public |
| 379 |
constructor Create; |
| 380 |
end; |
| 381 |
|
| 382 |
EAbFileTooLarge = class(EAbException) |
| 383 |
public |
| 384 |
constructor Create; |
| 385 |
end; |
| 386 |
|
| 387 |
procedure AbConvertException( const E : Exception; |
| 388 |
var eClass : TAbErrorClass; |
| 389 |
var eErrorCode : Integer ); |
| 390 |
|
| 391 |
|
| 392 |
implementation |
| 393 |
|
| 394 |
uses |
| 395 |
Classes, |
| 396 |
AbConst, |
| 397 |
AbResString; |
| 398 |
|
| 399 |
constructor EAbArchiveBusy.Create; |
| 400 |
begin |
| 401 |
inherited Create(AbArchiveBusyS); |
| 402 |
ErrorCode := AbArchiveBusy; |
| 403 |
end; |
| 404 |
|
| 405 |
constructor EAbBadStream.Create; |
| 406 |
begin |
| 407 |
inherited Create(AbBadStreamTypeS); |
| 408 |
FInnerException := nil; |
| 409 |
ErrorCode := AbBadStreamType; |
| 410 |
end; |
| 411 |
|
| 412 |
constructor EAbBadStream.CreateInner(aInnerException: Exception); |
| 413 |
begin |
| 414 |
inherited Create(AbBadStreamTypeS + #13#10 + aInnerException.Message); |
| 415 |
FInnerException := aInnerException; |
| 416 |
ErrorCode := AbBadStreamType; |
| 417 |
end; |
| 418 |
|
| 419 |
|
| 420 |
constructor EAbDuplicateName.Create; |
| 421 |
begin |
| 422 |
inherited Create(AbDuplicateNameS); |
| 423 |
ErrorCode := AbDuplicateName; |
| 424 |
end; |
| 425 |
|
| 426 |
constructor EAbNoSuchDirectory.Create; |
| 427 |
begin |
| 428 |
inherited Create(AbNoSuchDirectoryS); |
| 429 |
ErrorCode := AbNoSuchDirectory; |
| 430 |
end; |
| 431 |
|
| 432 |
constructor EAbInvalidSpanningThreshold.Create; |
| 433 |
begin |
| 434 |
inherited Create(AbInvalidThresholdS); |
| 435 |
ErrorCode := AbInvalidThreshold; |
| 436 |
end; |
| 437 |
|
| 438 |
constructor EAbFileNotFound.Create; |
| 439 |
begin |
| 440 |
inherited Create(AbFileNotFoundS); |
| 441 |
ErrorCode := AbFileNotFound; |
| 442 |
end; |
| 443 |
|
| 444 |
constructor EAbNoArchive.Create; |
| 445 |
begin |
| 446 |
inherited Create(AbNoArchiveS); |
| 447 |
ErrorCode := AbNoArchive; |
| 448 |
end; |
| 449 |
|
| 450 |
constructor EAbUserAbort.Create; |
| 451 |
begin |
| 452 |
inherited Create(AbUserAbortS); |
| 453 |
ErrorCode := AbUserAbort; |
| 454 |
end; |
| 455 |
|
| 456 |
constructor EAbZipBadSpanStream.Create; |
| 457 |
begin |
| 458 |
inherited Create(AbBadSpanStreamS); |
| 459 |
ErrorCode := AbBadSpanStream; |
| 460 |
end; |
| 461 |
|
| 462 |
constructor EAbZipBadCRC.Create; |
| 463 |
begin |
| 464 |
inherited Create(AbZipBadCRCS); |
| 465 |
ErrorCode := AbZipBadCRC; |
| 466 |
end; |
| 467 |
|
| 468 |
constructor EAbZipInflateBlock.Create; |
| 469 |
begin |
| 470 |
inherited Create(AbInflateBlockErrorS); |
| 471 |
ErrorCode := AbInflateBlockError; |
| 472 |
end; |
| 473 |
|
| 474 |
constructor EAbZipInvalid.Create; |
| 475 |
begin |
| 476 |
inherited Create(AbErrZipInvalidS); |
| 477 |
ErrorCode := AbErrZipInvalid; |
| 478 |
end; |
| 479 |
|
| 480 |
constructor EAbInvalidIndex.Create; |
| 481 |
begin |
| 482 |
inherited Create(AbInvalidIndexS); |
| 483 |
ErrorCode := AbInvalidIndex; |
| 484 |
end; |
| 485 |
|
| 486 |
constructor EAbZipInvalidFactor.Create; |
| 487 |
begin |
| 488 |
inherited Create(AbInvalidFactorS); |
| 489 |
ErrorCode := AbInvalidFactor; |
| 490 |
end; |
| 491 |
|
| 492 |
constructor EAbZipInvalidLFH.Create; |
| 493 |
begin |
| 494 |
inherited Create(AbInvalidLFHS); |
| 495 |
ErrorCode := AbInvalidLFH; |
| 496 |
end; |
| 497 |
|
| 498 |
constructor EAbZipInvalidMethod.Create; |
| 499 |
begin |
| 500 |
inherited Create(AbUnknownCompressionMethodS); |
| 501 |
ErrorCode := AbUnknownCompressionMethod; |
| 502 |
end; |
| 503 |
|
| 504 |
constructor EAbZipInvalidPassword.Create; |
| 505 |
begin |
| 506 |
inherited Create(AbInvalidPasswordS); |
| 507 |
ErrorCode := AbInvalidPassword; |
| 508 |
end; |
| 509 |
|
| 510 |
constructor EAbZipInvalidStub.Create; |
| 511 |
begin |
| 512 |
inherited Create(AbZipBadStubS); |
| 513 |
ErrorCode := AbZipBadStub; |
| 514 |
end; |
| 515 |
|
| 516 |
constructor EAbZipNoExtraction.Create; |
| 517 |
begin |
| 518 |
inherited Create(AbNoExtractionMethodS); |
| 519 |
ErrorCode := AbNoExtractionMethod; |
| 520 |
end; |
| 521 |
|
| 522 |
constructor EAbZipNoInsertion.Create; |
| 523 |
begin |
| 524 |
inherited Create(AbNoInsertionMethodS); |
| 525 |
ErrorCode := AbNoInsertionMethod; |
| 526 |
end; |
| 527 |
|
| 528 |
constructor EAbZipSpanOverwrite.Create; |
| 529 |
begin |
| 530 |
inherited Create(AbNoOverwriteSpanStreamS); |
| 531 |
ErrorCode := AbNoOverwriteSpanStream; |
| 532 |
end; |
| 533 |
|
| 534 |
constructor EAbZipStreamFull.Create; |
| 535 |
begin |
| 536 |
inherited Create(AbStreamFullS); |
| 537 |
ErrorCode := AbStreamFull; |
| 538 |
end; |
| 539 |
|
| 540 |
constructor EAbZipTruncate.Create; |
| 541 |
begin |
| 542 |
inherited Create(AbTruncateErrorS); |
| 543 |
ErrorCode := AbTruncateError; |
| 544 |
end; |
| 545 |
|
| 546 |
constructor EAbZipUnsupported.Create; |
| 547 |
begin |
| 548 |
inherited Create(AbUnsupportedCompressionMethodS); |
| 549 |
ErrorCode := AbUnsupportedCompressionMethod; |
| 550 |
end; |
| 551 |
|
| 552 |
constructor EAbZipVersion.Create; |
| 553 |
begin |
| 554 |
inherited Create(AbZipVersionNeededS); |
| 555 |
ErrorCode := AbZipVersionNeeded; |
| 556 |
end; |
| 557 |
|
| 558 |
constructor EAbReadError.Create; |
| 559 |
begin |
| 560 |
inherited Create(AbReadErrorS); |
| 561 |
ErrorCode := AbReadError; |
| 562 |
end; |
| 563 |
|
| 564 |
constructor EAbVMSInvalidOrigin.Create( Value : Integer ); |
| 565 |
begin |
| 566 |
inherited Create(Format(AbVMSInvalidOriginS, [Value])); |
| 567 |
ErrorCode := AbVMSInvalidOrigin; |
| 568 |
end; |
| 569 |
|
| 570 |
constructor EAbBBSReadTooManyBytes.Create(Count : Integer ); |
| 571 |
begin |
| 572 |
inherited Create(Format(AbBBSReadTooManyBytesS, [Count])); |
| 573 |
ErrorCode := AbBBSReadTooManyBytes; |
| 574 |
end; |
| 575 |
|
| 576 |
constructor EAbBBSSeekOutsideBuffer.Create; |
| 577 |
begin |
| 578 |
inherited Create(AbBBSSeekOutsideBufferS); |
| 579 |
ErrorCode := AbBBSSeekOutsideBuffer; |
| 580 |
end; |
| 581 |
|
| 582 |
constructor EAbBBSInvalidOrigin.Create; |
| 583 |
begin |
| 584 |
inherited Create(AbBBSInvalidOriginS); |
| 585 |
ErrorCode := AbBBSInvalidOrigin; |
| 586 |
end; |
| 587 |
|
| 588 |
constructor EAbBBSWriteTooManyBytes.Create(Count : Integer); |
| 589 |
begin |
| 590 |
inherited Create(Format(AbBBSWriteTooManyBytesS, [Count])); |
| 591 |
ErrorCode := AbBBSWriteTooManyBytes; |
| 592 |
end; |
| 593 |
|
| 594 |
constructor EAbVMSErrorOpenSwap.Create( const Value : string ); |
| 595 |
begin |
| 596 |
inherited Create(Format(AbVMSErrorOpenSwapS, [Value])); |
| 597 |
ErrorCode := AbVMSErrorOpenSwap; |
| 598 |
end; |
| 599 |
|
| 600 |
constructor EAbVMSSeekFail.Create( const Value : string ); |
| 601 |
begin |
| 602 |
inherited Create(Format(AbVMSSeekFailS, [Value])); |
| 603 |
ErrorCode := AbVMSSeekFail; |
| 604 |
end; |
| 605 |
|
| 606 |
constructor EAbVMSReadFail.Create( Count : Integer; const Value : string ); |
| 607 |
begin |
| 608 |
inherited Create(Format(AbVMSReadFailS, [Count, Value])); |
| 609 |
ErrorCode := AbVMSReadFail; |
| 610 |
end; |
| 611 |
|
| 612 |
constructor EAbVMSWriteFail.Create( Count : Integer; const Value : string ); |
| 613 |
begin |
| 614 |
inherited Create(Format(AbVMSWriteFailS, [Count, Value])); |
| 615 |
ErrorCode := AbVMSWriteFail; |
| 616 |
end; |
| 617 |
|
| 618 |
constructor EAbVMSWriteTooManyBytes.Create( Count : Integer ); |
| 619 |
begin |
| 620 |
inherited Create(Format(AbVMSWriteTooManyBytesS, [Count])); |
| 621 |
ErrorCode := AbVMSWriteTooManyBytes; |
| 622 |
end; |
| 623 |
|
| 624 |
constructor EAbSWSNotEndofStream.Create; |
| 625 |
begin |
| 626 |
inherited Create(AbSWSNotEndofStreamS); |
| 627 |
ErrorCode := AbSWSNotEndofStream; |
| 628 |
end; |
| 629 |
|
| 630 |
constructor EAbSWSSeekFailed.Create; |
| 631 |
begin |
| 632 |
inherited Create(AbSWSSeekFailedS); |
| 633 |
ErrorCode := AbSWSSeekFailed; |
| 634 |
end; |
| 635 |
|
| 636 |
constructor EAbSWSWriteFailed.Create; |
| 637 |
begin |
| 638 |
inherited Create(AbSWSWriteFailedS); |
| 639 |
ErrorCode := AbSWSWriteFailed; |
| 640 |
end; |
| 641 |
|
| 642 |
constructor EAbSWSInvalidOrigin.Create; |
| 643 |
begin |
| 644 |
inherited Create(AbSWSInvalidOriginS); |
| 645 |
ErrorCode := AbSWSInvalidOrigin; |
| 646 |
end; |
| 647 |
|
| 648 |
constructor EAbSWSInvalidNewOrigin.Create; |
| 649 |
begin |
| 650 |
inherited Create(AbSWSInvalidNewOriginS); |
| 651 |
ErrorCode := AbSWSInvalidNewOrigin; |
| 652 |
end; |
| 653 |
|
| 654 |
constructor EAbFCIFileOpenError.Create; |
| 655 |
begin |
| 656 |
inherited Create(AbFCIFileOpenErrorS); |
| 657 |
ErrorCode := AbFCIFileOpenError; |
| 658 |
end; |
| 659 |
|
| 660 |
constructor EAbNoCabinetDll.Create; |
| 661 |
begin |
| 662 |
inherited Create(AbNoCabinetDllErrorS); |
| 663 |
ErrorCode := AbNoCabinetDllError; |
| 664 |
end; |
| 665 |
|
| 666 |
constructor EAbFCIFileReadError.Create; |
| 667 |
begin |
| 668 |
inherited Create(AbFCIFileReadErrorS); |
| 669 |
ErrorCode := AbFCIFileReadError; |
| 670 |
end; |
| 671 |
|
| 672 |
constructor EAbFCIFileWriteError.Create; |
| 673 |
begin |
| 674 |
inherited Create(AbFCIFileWriteErrorS); |
| 675 |
ErrorCode := AbFCIFileWriteError; |
| 676 |
end; |
| 677 |
|
| 678 |
constructor EAbFCIFileCloseError.Create; |
| 679 |
begin |
| 680 |
inherited Create(AbFCIFileCloseErrorS); |
| 681 |
ErrorCode := AbFCIFileCloseError; |
| 682 |
end; |
| 683 |
|
| 684 |
constructor EAbFCIFileSeekError.Create; |
| 685 |
begin |
| 686 |
inherited Create(AbFCIFileSeekErrorS); |
| 687 |
ErrorCode := AbFCIFileSeekError; |
| 688 |
end; |
| 689 |
|
| 690 |
constructor EAbFCIFileDeleteError.Create; |
| 691 |
begin |
| 692 |
inherited Create(AbFCIFileDeleteErrorS); |
| 693 |
ErrorCode := AbFCIFileDeleteError; |
| 694 |
end; |
| 695 |
|
| 696 |
constructor EAbFCIAddFileError.Create; |
| 697 |
begin |
| 698 |
inherited Create(AbFCIAddFileErrorS); |
| 699 |
ErrorCode := AbFCIAddFileError; |
| 700 |
end; |
| 701 |
|
| 702 |
constructor EAbFCICreateError.Create; |
| 703 |
begin |
| 704 |
inherited Create(AbFCICreateErrorS); |
| 705 |
ErrorCode := AbFCICreateError; |
| 706 |
end; |
| 707 |
|
| 708 |
constructor EAbFCIFlushCabinetError.Create; |
| 709 |
begin |
| 710 |
inherited Create(AbFCIFlushCabinetErrorS); |
| 711 |
ErrorCode := AbFCIFlushCabinetError; |
| 712 |
end; |
| 713 |
|
| 714 |
constructor EAbFCIFlushFolderError.Create; |
| 715 |
begin |
| 716 |
inherited Create(AbFCIFlushFolderErrorS); |
| 717 |
ErrorCode := AbFCIFlushFolderError; |
| 718 |
end; |
| 719 |
|
| 720 |
constructor EAbFDICopyError.Create; |
| 721 |
begin |
| 722 |
inherited Create(AbFDICopyErrorS); |
| 723 |
ErrorCode := AbFDICopyError; |
| 724 |
end; |
| 725 |
|
| 726 |
constructor EAbFDICreateError.Create; |
| 727 |
begin |
| 728 |
inherited Create(AbFDICreateErrorS); |
| 729 |
ErrorCode := AbFDICreateError; |
| 730 |
end; |
| 731 |
|
| 732 |
constructor EAbInvalidCabTemplate.Create; |
| 733 |
begin |
| 734 |
inherited Create(AbInvalidCabTemplateS); |
| 735 |
ErrorCode := AbInvalidCabTemplate; |
| 736 |
end; |
| 737 |
|
| 738 |
constructor EAbInvalidCabFile.Create; |
| 739 |
begin |
| 740 |
inherited Create(AbInvalidCabFileS); |
| 741 |
ErrorCode := AbInvalidCabFile; |
| 742 |
end; |
| 743 |
|
| 744 |
procedure AbConvertException( const E : Exception; |
| 745 |
var eClass : TAbErrorClass; |
| 746 |
var eErrorCode : Integer ); |
| 747 |
begin |
| 748 |
eClass := ecOther; |
| 749 |
eErrorCode := 0; |
| 750 |
if E is EAbException then begin |
| 751 |
eClass := ecAbbrevia; |
| 752 |
eErrorCode := (E as EAbException).ErrorCode; |
| 753 |
end |
| 754 |
else if E is EInOutError then begin |
| 755 |
eClass := ecInOutError; |
| 756 |
eErrorCode := (E as EInOutError).ErrorCode; |
| 757 |
end |
| 758 |
else if E is EFilerError then |
| 759 |
eClass := ecFilerError |
| 760 |
else if E is EFOpenError then |
| 761 |
eClass := ecFileOpenError |
| 762 |
else if E is EFCreateError then |
| 763 |
eClass := ecFileCreateError; |
| 764 |
end; |
| 765 |
|
| 766 |
{ EAbUnhandledType } |
| 767 |
|
| 768 |
constructor EAbUnhandledType.Create; |
| 769 |
begin |
| 770 |
inherited Create(AbUnhandledFileTypeS); |
| 771 |
ErrorCode := AbUnhandledFileType; |
| 772 |
end; |
| 773 |
|
| 774 |
{ EAbGzipBadCRC } |
| 775 |
|
| 776 |
constructor EAbGzipBadCRC.Create; |
| 777 |
begin |
| 778 |
inherited Create(AbGzipBadCRCS); |
| 779 |
ErrorCode := AbGzipBadCRC; |
| 780 |
end; |
| 781 |
|
| 782 |
{ EAbGzipBadFileSize } |
| 783 |
|
| 784 |
constructor EAbGzipBadFileSize.Create; |
| 785 |
begin |
| 786 |
inherited Create(AbGzipBadFileSizeS); |
| 787 |
ErrorCode := AbGzipBadFileSize; |
| 788 |
end; |
| 789 |
|
| 790 |
{ EAbGzipInvalid } |
| 791 |
|
| 792 |
constructor EAbGzipInvalid.Create; |
| 793 |
begin |
| 794 |
inherited Create(AbSpanningNotSupportedS); |
| 795 |
ErrorCode := AbSpanningNotSupported; |
| 796 |
|
| 797 |
end; |
| 798 |
|
| 799 |
{ EAbTarInvalid } |
| 800 |
|
| 801 |
constructor EAbTarInvalid.Create; |
| 802 |
begin |
| 803 |
inherited Create(AbTarInvalidS); |
| 804 |
ErrorCode := AbTarInvalid; |
| 805 |
end; |
| 806 |
|
| 807 |
{ EAbTarBadFileName } |
| 808 |
|
| 809 |
constructor EAbTarBadFileName.Create; |
| 810 |
begin |
| 811 |
inherited Create(AbTarBadFileNameS); |
| 812 |
ErrorCode := AbTarBadFileName; |
| 813 |
end; |
| 814 |
|
| 815 |
{ EAbTarBadLinkName } |
| 816 |
|
| 817 |
constructor EAbTarBadLinkName.Create; |
| 818 |
begin |
| 819 |
inherited Create(AbTarBadLinkNameS); |
| 820 |
ErrorCode := AbTarBadLinkName; |
| 821 |
end; |
| 822 |
|
| 823 |
{ EAbTarBadOp } |
| 824 |
|
| 825 |
constructor EAbTarBadOp.Create; |
| 826 |
begin |
| 827 |
inherited Create(AbTarBadOpS); |
| 828 |
ErrorCode := AbTarBadOp; |
| 829 |
end; |
| 830 |
|
| 831 |
{ EAbSpanningNotSupported } |
| 832 |
|
| 833 |
constructor EAbSpanningNotSupported.Create; |
| 834 |
begin |
| 835 |
inherited Create(AbSpanningNotSupportedS); |
| 836 |
ErrorCode := AbSpanningNotSupported; |
| 837 |
end; |
| 838 |
|
| 839 |
{ EAbFileTooLarge } |
| 840 |
|
| 841 |
constructor EAbFileTooLarge.Create; |
| 842 |
begin |
| 843 |
{TODO Create const and fix wording} |
| 844 |
inherited Create(AbFileSizeTooBigS); |
| 845 |
end; |
| 846 |
|
| 847 |
end. |