Skip to content

Commit e81a489

Browse files
@W-21933885: [MSDK Android] App Attestation Implementation (Implement Salesforce App Attestation ECA Plugin Challenge API Error Type)
1 parent c4f4499 commit e81a489

2 files changed

Lines changed: 6 additions & 17 deletions

File tree

libs/SalesforceSDK/src/com/salesforce/androidsdk/rest/AppAttestationChallengeApiClient.kt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,9 @@ internal class AppAttestationChallengeApiClient(
7171
return if (restResponse.isSuccess && responseBodyString != null) {
7272
responseBodyString
7373
} else {
74-
runCatching {
75-
val errorResponseBody = SfapApiErrorResponseBody.fromJson(responseBodyString) // TODO: Review error type. ECJ20260414
76-
throw AppAttestationChallengeApiException(
77-
message = errorResponseBody.message ?: "The server did not provide a message.",
78-
source = errorResponseBody.sourceJson ?: "Source JSON could not be determined."
79-
)
80-
}.getOrElse {
81-
throw AppAttestationChallengeApiException(
82-
message = "The server returned an unrecognized error response.",
83-
source = responseBodyString
84-
)
85-
}
74+
throw AppAttestationChallengeApiException(
75+
source = responseBodyString
76+
)
8677
}
8778
}
8879
}

libs/SalesforceSDK/src/com/salesforce/androidsdk/rest/AppAttestationChallengeApiException.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ package com.salesforce.androidsdk.rest
3131
* failure response.
3232
* See https://docs.google.com/document/d/1MGw0-dO4Q-CJLNuqYBSYKAbEUy484lpLLX20ZIvwU6Y/edit?tab=t.0
3333
* TODO: Replace with final documentation when available. ECJ20260311
34-
* TODO: Determine actual properties when final documentation is available. ECJ20260311
35-
* @param message The `sfap_api` error message
36-
* @param source The original `sfap_api` error response body
34+
* @param source The original Salesforce Mobile App Attestation Challenge API
35+
* error response body
3736
*/
3837
class AppAttestationChallengeApiException(
39-
message: String,
4038
val source: String
41-
) : Exception(message)
39+
) : Exception()

0 commit comments

Comments
 (0)