@@ -117,15 +117,8 @@ class ApiImpl(config: Config) extends DatabusApi {
117
117
override def getGraph (repo : String , path : String , prefix : Option [String ])(request : javax.servlet.http.HttpServletRequest ): scala.util.Try [String ] =
118
118
readGraph(repo, path, prefix)(request)
119
119
120
- override def getGraphMapException404 (e : Throwable )(request : javax.servlet.http.HttpServletRequest ): Option [org.dbpedia.databus.swagger.model.OperationFailure ] = e match {
121
- case _ : FileNotFoundException => Some (OperationFailure (e.getMessage))
122
- case _ : NoSuchFileException => Some (OperationFailure (e.getMessage))
123
- case _ : RepositoryNotFoundException => Some (OperationFailure (" File not found." ))
124
- case _ : MissingObjectException => Some (OperationFailure (" File not found." ))
125
- case _ : UnsupportedFormatException => Some (OperationFailure (e.getMessage))
126
- case _ => None
127
- }
128
-
120
+ override def getGraphMapException404 (e : Throwable )(request : javax.servlet.http.HttpServletRequest ): Option [org.dbpedia.databus.swagger.model.OperationFailure ] =
121
+ getFileMapException404(e)(request)
129
122
override def shaclValidate (dataid : Array [Byte ], shacl : Array [Byte ])(request : HttpServletRequest ): Try [String ] = {
130
123
val outLang = getLangFromAcceptHeader(request).flatMap(rdf).getOrElse(DefaultFormat )
131
124
setResponseHeaders(Map (" Content-Type" -> outLang.lang.getContentType.toHeaderString))(request)
@@ -148,6 +141,7 @@ class ApiImpl(config: Config) extends DatabusApi {
148
141
case _ : FileNotFoundException => Some (OperationFailure (e.getMessage))
149
142
case _ : NoSuchFileException => Some (OperationFailure (e.getMessage))
150
143
case _ : RepositoryNotFoundException => Some (OperationFailure (" File not found." ))
144
+ case _ : ArrayIndexOutOfBoundsException => Some (OperationFailure (" File not found" ))
151
145
case _ : MissingObjectException => Some (OperationFailure (" File not found." ))
152
146
case _ : UnsupportedFormatException => Some (OperationFailure (e.getMessage))
153
147
case _ => None
0 commit comments