All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.revenuemonster.sdk.util.RMException.kt Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package io.revenuemonster.sdk.util

import io.revenuemonster.sdk.model.Error
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json

class RMException(response : String) : Exception(response){

    private val json = Json {
        this.ignoreUnknownKeys = true
        this.coerceInputValues = true
    }

    private val e = json.decodeFromString(this.message!!)
    val errorCode = e.error.code
    val errorMessage = e.error.message

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy