Skip to content

Commit

Permalink
Fix for scala 2.13.3 (Source.fromResource throws FileNotFoundExceptio…
Browse files Browse the repository at this point in the history
…n) (#228)
d10xa authored Aug 1, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9c9edaa commit fe7cbfd
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name := "jadd"
organization in ThisBuild := "ru.d10xa"

scalaVersion in ThisBuild := "2.13.1"
scalaVersion in ThisBuild := "2.13.3"
mainClass in Compile := Some("ru.d10xa.jadd.Jadd")
licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT")))
description := "Command-line tool for adding dependencies to gradle/maven/sbt build files"
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package ru.d10xa.jadd.shortcuts

import java.io.FileNotFoundException

import cats.effect.Sync
import cats.implicits._
import ru.d10xa.jadd.core.Artifact
@@ -55,7 +57,12 @@ class ArtifactInfoFinder(
)
}.toOption
}
.recover { case _: NullPointerException => None }
.recover {
// https://github.com/scala/scala/pull/8443 Throw
// FileNotFoundException in Source.fromResource
case _: NullPointerException => None
case _: FileNotFoundException => None // since 2.13.3
}
}

// find file by $groupId:$artifactId.json and then $groupId.json

0 comments on commit fe7cbfd

Please sign in to comment.