Skip to content

Commit

Permalink
Merge pull request #3265 from tgodzik/add-try
Browse files Browse the repository at this point in the history
Add try in order not to break debugging session
  • Loading branch information
tgodzik authored Nov 3, 2021
2 parents cfa30f3 + fdc619d commit 15e98f4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private[debug] final class SourcePathAdapter(
}
}

def toMetalsPath(sourcePath: String): Option[AbsolutePath] = {
def toMetalsPath(sourcePath: String): Option[AbsolutePath] = try {
val sourceUri =
Try(URI.create(sourcePath)).getOrElse(Paths.get(sourcePath).toUri())
sourceUri.getScheme match {
Expand All @@ -47,6 +47,10 @@ private[debug] final class SourcePathAdapter(
case "file" => Some(AbsolutePath(Paths.get(sourceUri)))
case _ => None
}
} catch {
case e: Throwable =>
scribe.error(s"Could not resolve $sourcePath", e)
None
}
}

Expand Down

0 comments on commit 15e98f4

Please sign in to comment.