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

notion.api.v1.exception.NotionOAuthAPIError.kt Maven / Gradle / Ivy

package notion.api.v1.exception

import notion.api.v1.http.NotionHttpResponse
import notion.api.v1.model.error.OAuthError

class NotionOAuthAPIError
@JvmOverloads
constructor(
    val error: OAuthError,
    val httpResponse: NotionHttpResponse,
    override val message: String = buildMessage(httpResponse, error),
    override val cause: Throwable? = null
) : RuntimeException(message, cause) {

  companion object {
    private fun buildMessage(response: NotionHttpResponse, error: OAuthError) =
        "Got an error from Notion (status: ${response.status}, error: ${error.error})"
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy