Skip to content

Commit 70c4f9d

Browse files
committed
Use FileNotFoundException
1 parent 7f41532 commit 70c4f9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,13 +472,14 @@ object KaTeX {
472472

473473
// Provides access to resources of a bundled WebJar.
474474
class WebJar(artifactId: String) {
475+
import java.io.FileNotFoundException
475476
private val classLoader = classOf[WebJar].getClassLoader
476477

477478
private val version: String =
478479
val propsPath = s"META-INF/maven/org.webjars.npm/$artifactId/pom.properties"
479480
val stream = classLoader.getResourceAsStream(propsPath)
480481
if stream == null then
481-
throw IllegalStateException(
482+
throw FileNotFoundException(
482483
s"Could not find pom.properties for webjar '$artifactId' on the classpath."
483484
)
484485
val props = java.util.Properties()
@@ -490,7 +491,7 @@ class WebJar(artifactId: String) {
490491
val resourcePath = s"META-INF/resources/webjars/$artifactId/$version/$path"
491492
val stream = classLoader.getResourceAsStream(resourcePath)
492493
if stream == null then
493-
throw IllegalStateException(
494+
throw FileNotFoundException(
494495
s"Could not find resource '$path' in webjar '$artifactId' ($version)."
495496
)
496497
String(stream.readAllBytes())

0 commit comments

Comments
 (0)