Skip to content

Commit

Permalink
Merge pull request #8 from aqman1/master
Browse files Browse the repository at this point in the history
Added processing response isn't JSON
  • Loading branch information
Vasily Karyaev authored Dec 2, 2016
2 parents 4aa2c91 + c159b1c commit f5747a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePass
name 'Vasily Karyaev'
email '[email protected]'
}
developer {
id 'aqman1'
name 'Grigory Osin'
email '[email protected]'
}
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/com/ecwid/maleorang/MailchimpClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ open class MailchimpClient protected constructor (
var description = response.reasonPhrase

if (response.responseBody != null) {
val error = JsonParser().parse(response.responseBody).asJsonObject
code = error.get("status").asInt
description = error.get("detail").asString
try {
val error = JsonParser().parse(response.responseBody).asJsonObject
code = error.get("status").asInt
description = error.get("detail").asString
} catch (e: Exception){}
}

throw MailchimpException(code, description)
Expand Down

0 comments on commit f5747a8

Please sign in to comment.