File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Tests/FeaturevisorSDKTests Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ public class FeaturevisorInstance {
261
261
self ? . startRefreshing ( )
262
262
}
263
263
case . failure( let error) :
264
- self ? . logger. error ( " Failed to fetch datafile: \( error) " )
264
+ self ? . logger. error ( " failed to fetch datafile" , [ " error " : error ] )
265
265
}
266
266
}
267
267
}
Original file line number Diff line number Diff line change @@ -1149,6 +1149,7 @@ class FeaturevisorInstanceTests: XCTestCase {
1149
1149
// GIVEN
1150
1150
let expectation = expectation ( description: " datafile_error_response_expectation " )
1151
1151
var wasDatafileContentFetchErrorThrown = false
1152
+ var errorThrownDetails : String ?
1152
1153
var options = InstanceOptions . default
1153
1154
options. datafileUrl = " https://featurevisor.datafilecontent.com "
1154
1155
options. handleDatafileFetch = { _ in
@@ -1159,8 +1160,9 @@ class FeaturevisorInstanceTests: XCTestCase {
1159
1160
return
1160
1161
}
1161
1162
1162
- if message. contains ( " Failed to fetch datafile" ) {
1163
+ if message. contains ( " failed to fetch datafile" ) {
1163
1164
wasDatafileContentFetchErrorThrown = true
1165
+ errorThrownDetails = details? . description
1164
1166
}
1165
1167
1166
1168
expectation. fulfill ( )
@@ -1179,6 +1181,10 @@ class FeaturevisorInstanceTests: XCTestCase {
1179
1181
// THEN
1180
1182
waitForExpectations ( timeout: 1 )
1181
1183
XCTAssertTrue ( wasDatafileContentFetchErrorThrown)
1184
+ XCTAssertEqual (
1185
+ errorThrownDetails,
1186
+ " [ \" error \" : FeaturevisorSDK.FeaturevisorError.unparseableJSON(data: nil, errorMessage: \" Error :( \" )] "
1187
+ )
1182
1188
}
1183
1189
1184
1190
func testShouldGetVariable( ) {
You can’t perform that action at this time.
0 commit comments