From bea3fa866f5e41a32c533c653e9c8a9ac721f7f4 Mon Sep 17 00:00:00 2001 From: Kirill Yankov Date: Tue, 24 Jan 2023 20:53:27 +0100 Subject: [PATCH] Fix #33 --- src/main/scala/org/dbpedia/databus/ApiImpl.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/scala/org/dbpedia/databus/ApiImpl.scala b/src/main/scala/org/dbpedia/databus/ApiImpl.scala index 852ec82..9001ad8 100644 --- a/src/main/scala/org/dbpedia/databus/ApiImpl.scala +++ b/src/main/scala/org/dbpedia/databus/ApiImpl.scala @@ -13,7 +13,7 @@ import org.dbpedia.databus.ApiImpl.Config import org.dbpedia.databus.RdfConversions.{contextUri, generateGraphId, graphToBytes, mapContentType, readModel} import org.dbpedia.databus.swagger.api.DatabusApi import org.dbpedia.databus.swagger.model.{OperationFailure, OperationSuccess} -import org.eclipse.jgit.errors.RepositoryNotFoundException +import org.eclipse.jgit.errors.{MissingObjectException, RepositoryNotFoundException} import sttp.model.Uri import virtuoso.jdbc4.VirtuosoException @@ -95,7 +95,8 @@ class ApiImpl(config: Config) extends DatabusApi { override def getFileMapException404(e: Throwable)(request: HttpServletRequest): Option[OperationFailure] = e match { case _: FileNotFoundException => Some(OperationFailure(e.getMessage)) case _: NoSuchFileException => Some(OperationFailure(e.getMessage)) - case _: RepositoryNotFoundException => Some(OperationFailure(e.getMessage)) + case _: RepositoryNotFoundException => Some(OperationFailure("File not found.")) + case _: MissingObjectException => Some(OperationFailure("File not found.")) case _ => None }