File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -796,7 +796,7 @@ func completeValueCatchingError(
796
796
result: result
797
797
) . flatMapError { error -> EventLoopFuture < Any ? > in
798
798
guard let error = error as? GraphQLError else {
799
- fatalError ( )
799
+ return exeContext . eventLoopGroup . next ( ) . makeFailedFuture ( error )
800
800
}
801
801
exeContext. append ( error: error)
802
802
return exeContext. eventLoopGroup. next ( ) . makeSucceededFuture ( nil )
@@ -809,7 +809,7 @@ func completeValueCatchingError(
809
809
exeContext. append ( error: error)
810
810
return exeContext. eventLoopGroup. next ( ) . makeSucceededFuture ( nil )
811
811
} catch {
812
- fatalError ( )
812
+ return exeContext . eventLoopGroup . next ( ) . makeFailedFuture ( error )
813
813
}
814
814
}
815
815
Original file line number Diff line number Diff line change @@ -663,7 +663,13 @@ extension Map : Codable {
663
663
664
664
switch self {
665
665
case . undefined:
666
- fatalError ( " undefined values should have been excluded from encoding " )
666
+ throw EncodingError . invalidValue (
667
+ self ,
668
+ EncodingError . Context (
669
+ codingPath: [ ] ,
670
+ debugDescription: " undefined values should have been excluded from encoding "
671
+ )
672
+ )
667
673
case . null:
668
674
try container. encodeNil ( )
669
675
case let . bool( value) :
Original file line number Diff line number Diff line change @@ -35,7 +35,13 @@ public struct MapSerialization {
35
35
static func object( with map: Map ) throws -> NSObject {
36
36
switch map {
37
37
case . undefined:
38
- fatalError ( " undefined values should have been excluded from serialization " )
38
+ throw EncodingError . invalidValue (
39
+ self ,
40
+ EncodingError . Context (
41
+ codingPath: [ ] ,
42
+ debugDescription: " undefined values should have been excluded from serialization "
43
+ )
44
+ )
39
45
case . null:
40
46
return NSNull ( )
41
47
case let . bool( value) :
You can’t perform that action at this time.
0 commit comments