|
1 | 1 | /****************************************************************************
|
2 |
| - * Copyright 2022, Optimizely, Inc. and contributors * |
| 2 | + * Copyright 2022-2023, Optimizely, Inc. and contributors * |
3 | 3 | * *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); *
|
5 | 5 | * you may not use this file except in compliance with the License. *
|
@@ -108,7 +108,8 @@ type APIManager interface {
|
108 | 108 | "customer"
|
109 | 109 | ],
|
110 | 110 | "extensions": {
|
111 |
| - "classification": "InvalidIdentifierException" |
| 111 | + "code": "INVALID_IDENTIFIER_EXCEPTION", |
| 112 | + "classification": "DataFetchingException" |
112 | 113 | }
|
113 | 114 | }
|
114 | 115 | ],
|
@@ -160,7 +161,7 @@ func (sm *DefaultSegmentAPIManager) FetchQualifiedSegments(apiKey, apiHost, user
|
160 | 161 | if odpErrors, ok := sm.extractComponent("errors", responseMap).([]interface{}); ok {
|
161 | 162 | if odpError, ok := odpErrors[0].(map[string]interface{}); ok {
|
162 | 163 | if errorClass, ok := sm.extractComponent("extensions.classification", odpError).(string); ok {
|
163 |
| - if errorClass == "InvalidIdentifierException" { |
| 164 | + if errorCode, ok := sm.extractComponent("extensions.code", odpError).(string); ok && errorCode == "INVALID_IDENTIFIER_EXCEPTION" { |
164 | 165 | return nil, errors.New(utils.InvalidSegmentIdentifier)
|
165 | 166 | }
|
166 | 167 | return nil, fmt.Errorf(utils.FetchSegmentsFailedError, errorClass)
|
|
0 commit comments