Skip to content

Commit

Permalink
fix(subversion): Throw IOException instead of DownloadException
Browse files Browse the repository at this point in the history
The `initWorkingTree()` function is documented to throw `IOException`,
and that is what callers catch. Avoid ORT to crash on a

`UnknownHostException` -> `SVNException` -> `DownloadException`

chain by re-throwing a `IOException` here.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Feb 15, 2024
1 parent db15d0c commit 141be6e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
package org.ossreviewtoolkit.plugins.versioncontrolsystems.subversion

import java.io.File
import java.io.IOException
import java.net.InetSocketAddress
import java.net.URI
import java.nio.file.Paths

import org.apache.logging.log4j.kotlin.logger

import org.ossreviewtoolkit.downloader.DownloadException
import org.ossreviewtoolkit.downloader.VersionControlSystem
import org.ossreviewtoolkit.downloader.WorkingTree
import org.ossreviewtoolkit.model.VcsInfo
Expand Down Expand Up @@ -97,7 +97,7 @@ class Subversion : VersionControlSystem() {
} catch (e: SVNException) {
e.showStackTrace()

throw DownloadException("Unable to initialize a $type working tree in '$targetDir' from ${vcs.url}.", e)
throw IOException("Unable to initialize a $type working tree in '$targetDir' from ${vcs.url}.", e)
}

return getWorkingTree(targetDir)
Expand Down

0 comments on commit 141be6e

Please sign in to comment.