(fix) cleanup Gradle-Build
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package at.mocode.routes
|
||||
|
||||
import at.mocode.model.Artikel
|
||||
import at.mocode.model.ArtikelRepository
|
||||
import at.mocode.model.PostgresArtikelRepository
|
||||
import at.mocode.shared.model.Artikel
|
||||
import com.benasher44.uuid.uuidFrom
|
||||
import io.ktor.http.*
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.request.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
import kotlin.collections.mapOf
|
||||
|
||||
fun Route.artikelRoutes() {
|
||||
val artikelRepository: ArtikelRepository = PostgresArtikelRepository()
|
||||
@@ -38,7 +38,7 @@ fun Route.artikelRoutes() {
|
||||
} else {
|
||||
call.respond(HttpStatusCode.NotFound, mapOf("error" to "Artikel not found"))
|
||||
}
|
||||
} catch (e: IllegalArgumentException) {
|
||||
} catch (_: IllegalArgumentException) {
|
||||
call.respond(HttpStatusCode.BadRequest, mapOf("error" to "Invalid UUID format"))
|
||||
} catch (e: Exception) {
|
||||
call.respond(HttpStatusCode.InternalServerError, mapOf("error" to e.message))
|
||||
@@ -99,7 +99,7 @@ fun Route.artikelRoutes() {
|
||||
} else {
|
||||
call.respond(HttpStatusCode.NotFound, mapOf("error" to "Artikel not found"))
|
||||
}
|
||||
} catch (e: IllegalArgumentException) {
|
||||
} catch (_: IllegalArgumentException) {
|
||||
call.respond(HttpStatusCode.BadRequest, mapOf("error" to "Invalid UUID format"))
|
||||
} catch (e: Exception) {
|
||||
call.respond(HttpStatusCode.BadRequest, mapOf("error" to e.message))
|
||||
@@ -120,7 +120,7 @@ fun Route.artikelRoutes() {
|
||||
} else {
|
||||
call.respond(HttpStatusCode.NotFound, mapOf("error" to "Artikel not found"))
|
||||
}
|
||||
} catch (e: IllegalArgumentException) {
|
||||
} catch (_: IllegalArgumentException) {
|
||||
call.respond(HttpStatusCode.BadRequest, mapOf("error" to "Invalid UUID format"))
|
||||
} catch (e: Exception) {
|
||||
call.respond(HttpStatusCode.InternalServerError, mapOf("error" to e.message))
|
||||
|
||||
Reference in New Issue
Block a user