본문 바로가기

error4

[Mono][Feign] 404 error custom throw feign에서 404에러 발생 시 에러 핸들링 Mono.fromCallable { feign.get() } .onErrorReturn(FeignException.NotFound::class.java, null) .subscribeOn(Schedulers.elastic()) Feign 에서 404 에러발생시 FeignException.NotFound 에러를 뱉는다. onErrorReturn으로 이를 catch 하여 원하는 응답값을 반환해준다. 2020. 8. 16.
[spring] webClient error 처리 기존코드 WebClient.create().get() .uri("http://~~~") .retrieve() .bodyToMono(CustomResponse::class.java) .onErrorMap { e -> log.error(e.message) e // return e } .map { // return } CustomResponse 타입의 body를 가져와서 처리한다. 에러가 발생하는 경우(4xx, 5xx) onErrorMap이 에러를 캐치해서 log.error로 해당에러를 찍는다. WebClient.create().get() .uri("http://~~~~") .exchange() .flatMap { response -> // get header val header = response.heade.. 2019. 5. 8.
[Error][WebClient] UnsupportedMediaTypeException return WebClient.create().get() .uri( ~~~ ) .headers { ~~~ } .retrieve() .bodyToMono(Member::class.java)Colored by Color ScriptercswebClient를 이용해서 get한 결과를 Member 형태로 받아와서 Mono를 반환하는 코드를 짜고 돌려보았다. There was an unexpected error (type=Internal Server Error, status=500).Content type 'text/plain;charset=UTF-8' not supported for bodyType=Memberorg.springframework.web.reactive.function.UnsupportedMedi.. 2019. 2. 26.
[kotlin] Smart cast to 'Type' is impossible, because 'xxx' is a mutable property that could have been changed by this time. data class People(var name: String) // name이 변경될 수 있는 var people: Peopleval names: MutableList = mutableListOf()people.name?.let { names.add(people.name) // error}Colored by Color Scriptercs 변경될 수 있는 var 타입을 다른 변수에 대입하려고 할 때 에러가 발생한다. Smart cast to 'List' is impossible, because 'people.name' is a mutable property that could have been changed by this time.cs 에러를 읽어보면 people.name이 변경될 수 있는 mutable.. 2019. 1. 19.