Adds image retrieval endpoint
This commit is contained in:
@@ -14,6 +14,7 @@ import org.springframework.web.bind.MethodArgumentNotValidException
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
||||
import org.springframework.web.bind.annotation.ResponseStatus
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice
|
||||
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException
|
||||
import org.springframework.web.multipart.MaxUploadSizeExceededException
|
||||
import java.net.SocketTimeoutException
|
||||
|
||||
@@ -96,6 +97,12 @@ class ExceptionHandler {
|
||||
return "Unable to connect. Try again later."
|
||||
}
|
||||
|
||||
@ExceptionHandler(MethodArgumentTypeMismatchException::class)
|
||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||
fun argumentMismatchException(): String? {
|
||||
return "Invalid parameter value."
|
||||
}
|
||||
|
||||
private fun simpleMap(key: String, value: String?): Map<String, String?> {
|
||||
return mapOf(Pair(key, value))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user