11![ moko-errors] ( img/logo.png )
22
3- [ ![ GitHub license] ( https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat )] ( http://www.apache.org/licenses/LICENSE-2.0 ) [ ![ Download] ( https://img.shields.io/maven-central/v/dev.icerock.moko/errors ) ] ( https://repo1.maven.org/maven2/dev/icerock/moko/errors ) ![ kotlin-version] ( https://img.shields.io/badge/kotlin-1.4.31-orange )
4-
3+ [ ![ GitHub license] ( https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat )] ( http://www.apache.org/licenses/LICENSE-2.0 ) [ ![ Download] ( https://img.shields.io/maven-central/v/dev.icerock.moko/errors ) ] ( https://repo1.maven.org/maven2/dev/icerock/moko/errors ) ![ kotlin-version] ( https://kotlin-version.aws.icerock.dev/kotlin-version?group=dev.icerock.moko&name=errors )
54# Mobile Kotlin errors
65This is a Kotlin MultiPlatform library that provides automatic exception handling and
76automatic error displaying to a screen.
87
98## Table of Contents
109- [ Features] ( #features )
1110- [ Requirements] ( #requirements )
12- - [ Versions] ( #versions )
1311- [ Installation] ( #installation )
1412- [ Usage] ( #usage )
1513- [ Samples] ( #samples )
@@ -29,23 +27,9 @@ on the platforms. Converts the exception class to an error object to display. Th
2927` SelectorErrorPresenter ` - for selecting error presenter by some custom condition.
3028
3129## Requirements
32- - Gradle version 6.0 +
30+ - Gradle version 6.8 +
3331- Android API 16+
34- - iOS version 9.0+
35-
36- ## Versions
37- ### Bintray
38- - kotlin 1.3.72
39- - 0.1.0
40- - 0.2.0
41- - 0.2.1
42- - kotlin 1.4.0
43- - 0.3.0
44- - kotlin 1.4.21
45- - 0.3.1
46- ### mavenCentral
47- - kotlin 1.4.31
48- - 0.3.2
32+ - iOS version 11.0+
4933
5034## Installation
5135root build.gradle
@@ -60,7 +44,7 @@ allprojects {
6044project build.gradle
6145``` groovy
6246dependencies {
63- commonMainApi("dev.icerock.moko:errors:0.3.2 ")
47+ commonMainApi("dev.icerock.moko:errors:0.4.0 ")
6448}
6549```
6650
@@ -181,14 +165,15 @@ fun onSendRequest() {
181165}
182166```
183167
184- Also you can add some custom ` catch ` handlers for ` ExceptionHandler ` :
168+ Also you can add some custom ` catch ` handlers for ` ExceptionHandler ` that work as a catch in the
169+ try/catch operator:
185170
186171``` kotlin
187172fun onSendRequest () {
188173 viewModelScope.launch {
189174 exceptionHandler.handle {
190175 serverRequest()
191- }.catch <IllegalArgumentException > { // Specifying a specific exception class
176+ }.catch <IllegalArgumentException > { // Specifying exception class
192177 // Some custom handler code
193178 false // true - cancels ErrorPresenter; false - allows execution of ErrorsPresenter
194179 }.execute() // Starts code execution in `handle` lambda
0 commit comments