Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
fix java exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
JesusMcCloud committed Oct 27, 2017
1 parent 2ac3dfb commit bfb3f3e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tor/src/main/kotlin/org/berndpruenster/netlayer/tor/Tor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ private class Control(private val con: TorController) {
internal data class HsContainer(internal val hostname: String, internal val handler: TorEventHandler)


abstract class Tor @Throws(TorCtlException::class) protected constructor(protected val context: TorContext, bridgeLines: Collection<String>? = null) {
abstract class Tor @Throws(TorCtlException::class) protected constructor(protected val context: TorContext,
bridgeLines: Collection<String>? = null) {


private val eventHandler: TorEventHandler = TorEventHandler()
Expand All @@ -140,9 +141,12 @@ abstract class Tor @Throws(TorCtlException::class) protected constructor(protect
return field
}


init {
control = bootstrap()
control = try {
bootstrap()
} catch (e: Exception) {
throw TorCtlException(cause = e)
}
Runtime.getRuntime().addShutdownHook(Thread({ control.shutdown() }))
}

Expand Down

0 comments on commit bfb3f3e

Please sign in to comment.