-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into release/1.1.x
- Loading branch information
Showing
24 changed files
with
315 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletions
17
library/src/main/java/com/wultra/android/powerauth/networking/Api.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletions
17
library/src/main/java/com/wultra/android/powerauth/networking/ECIESInterceptor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletions
17
library/src/main/java/com/wultra/android/powerauth/networking/Endpoint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletions
17
library/src/main/java/com/wultra/android/powerauth/networking/Logger.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletions
17
library/src/main/java/com/wultra/android/powerauth/networking/data/Requests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletions
17
library/src/main/java/com/wultra/android/powerauth/networking/error/ApiError.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletions
17
library/src/main/java/com/wultra/android/powerauth/networking/error/ApiErrorCode.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
library/src/main/java/com/wultra/android/powerauth/networking/error/ApiErrorException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2022 Wultra s.r.o. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
|
||
package com.wultra.android.powerauth.networking.error | ||
|
||
/** | ||
* Error reported in functions using callback with `Result<T>` type. | ||
*/ | ||
class ApiErrorException( | ||
/** | ||
* Error code extracted from the response's error. | ||
*/ | ||
val errorCode: ApiErrorCode? = null, | ||
/** | ||
* The detailed message. | ||
*/ | ||
message: String? = null, | ||
/** | ||
* The cause of the exception. | ||
*/ | ||
cause: Throwable? = null | ||
|
||
): Exception(message, cause) { | ||
|
||
/** | ||
* Construct exception from existing [ApiError]. | ||
* | ||
* @param apiError Instance of [ApiError]. | ||
*/ | ||
constructor(apiError: ApiError) : this(apiError.error, apiError.e.message, apiError.e) | ||
|
||
/** | ||
* Construct exception from another exception. If exception is one from known exceptions, | ||
* then the [errorCode] property is also initialized. | ||
*/ | ||
constructor(cause: Throwable) : this(ApiError(cause).error, cause.message, cause) | ||
|
||
companion object { | ||
/** | ||
* Wrap any [Throwable] object into [ApiErrorException]. If throwable is already [ApiErrorException] | ||
* then return the object as is. | ||
*/ | ||
fun wrap(t: Throwable): ApiErrorException { | ||
return if (t is ApiErrorException) t else ApiErrorException(t) | ||
} | ||
} | ||
} |
17 changes: 11 additions & 6 deletions
17
library/src/main/java/com/wultra/android/powerauth/networking/error/ApiHttpException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletions
17
library/src/main/java/com/wultra/android/powerauth/networking/error/ErrorResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletions
17
library/src/main/java/com/wultra/android/powerauth/networking/error/ErrorResponseObject.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.