File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Tests/OptimizelyTests-Common Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ import Foundation
8585 "customer"
8686 ],
8787 "extensions": {
88- "classification": "InvalidIdentifierException"
88+ "code": "INVALID_IDENTIFIER_EXCEPTION",
89+ "classification": "DataFetchingException"
8990 }
9091 }
9192 ],
@@ -162,7 +163,7 @@ open class OdpSegmentApiManager {
162163 // most meaningful ODP errors are returned in 200 success JSON under {"errors": ...}
163164 if let odpErrors: [ [ String : Any ] ] = dict. extractComponent ( keyPath: " errors " ) {
164165 if let odpError = odpErrors. first, let errorClass: String = odpError. extractComponent ( keyPath: " extensions.classification " ) {
165- if errorClass == " InvalidIdentifierException " {
166+ if let errorCode : String = odpError . extractComponent ( keyPath : " extensions.code " ) , errorCode == " INVALID_IDENTIFIER_EXCEPTION " {
166167 returnError = . invalidSegmentIdentifier
167168 } else {
168169 returnError = . fetchSegmentsFailed( errorClass)
Original file line number Diff line number Diff line change @@ -435,7 +435,8 @@ extension OdpSegmentApiManagerTests {
435435 " customer "
436436 ],
437437 " extensions " : {
438- " classification " : " InvalidIdentifierException "
438+ " code " : " INVALID_IDENTIFIER_EXCEPTION " ,
439+ " classification " : " DataFetchingException "
439440 }
440441 }
441442 ],
You can’t perform that action at this time.
0 commit comments