@@ -419,6 +419,8 @@ extension Error {
419
419
}
420
420
~~~
421
421
- parameter errorCode: A `ParseError` code to compare to.
422
+
423
+ - returns: A boolean indicating wheter or not the `Error` is the `errorCode`
422
424
*/
423
425
public func equalsTo( _ errorCode: ParseError . Code ) -> Bool {
424
426
guard let error = self as? ParseError else {
@@ -441,7 +443,8 @@ extension Error {
441
443
- returns: An optional `ParseError`
442
444
*/
443
445
public func equalsTo( _ errorCode: ParseError . Code ) -> ParseError ? {
444
- guard let error = self as? ParseError , error. code == errorCode else {
446
+ guard let error = self as? ParseError ,
447
+ error. code == errorCode else {
445
448
return nil
446
449
}
447
450
return error
@@ -457,6 +460,8 @@ extension Error {
457
460
}
458
461
~~~
459
462
- parameter errorCodes: A variadic amount of zero or more of `ParseError` codes to compare to.
463
+
464
+ - returns: A boolean indicating wheter or not the `Error` is contained in the `errorCodes`
460
465
*/
461
466
public func containedIn( _ errorCodes: ParseError . Code ... ) -> Bool {
462
467
guard let error = self as? ParseError else {
@@ -479,7 +484,8 @@ extension Error {
479
484
- returns: An optional `ParseError`
480
485
*/
481
486
public func containedIn( _ errorCodes: ParseError . Code ... ) -> ParseError ? {
482
- guard let error = self as? ParseError , errorCodes. contains ( error. code) == true else {
487
+ guard let error = self as? ParseError ,
488
+ errorCodes. contains ( error. code) == true else {
483
489
return nil
484
490
}
485
491
return error
@@ -494,7 +500,9 @@ extension Error {
494
500
//Do stuff
495
501
}
496
502
~~~
497
- - parameter errorCodes: A variadic amount of zero or more of `ParseError` codes to compare to.
503
+ - parameter errorCodes: An array of zero or more of `ParseError` codes to compare to.
504
+
505
+ - returns: A boolean indicating wheter or not the `Error` is contained in the `errorCodes`
498
506
*/
499
507
public func containedIn( _ errorCodes: [ ParseError . Code ] ) -> Bool {
500
508
guard let error = self as? ParseError else {
@@ -512,12 +520,13 @@ extension Error {
512
520
print(parseError.description)
513
521
}
514
522
~~~
515
- - parameter errorCodes: A variadic amount of zero or more of `ParseError` codes to compare to.
523
+ - parameter errorCodes: An array of zero or more of `ParseError` codes to compare to.
516
524
517
525
- returns: An optional `ParseError`
518
526
*/
519
527
public func containedIn( _ errorCodes: [ ParseError . Code ] ) -> ParseError ? {
520
- guard let error = self as? ParseError , errorCodes. contains ( error. code) == true else {
528
+ guard let error = self as? ParseError ,
529
+ errorCodes. contains ( error. code) == true else {
521
530
return nil
522
531
}
523
532
return error
0 commit comments