Created
March 6, 2018 02:34
-
-
Save enzobonggio/8807cfc7e63c73c38fad9018a5c76702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootApplication | |
@RestController | |
public class Application { | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
} | |
@GetMapping("/something") | |
Mono<Void> something() { | |
return Mono.error(new Throwable("mensaje")); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ControllerAdvice | |
public class ExHandler { | |
@ExceptionHandler(Throwable.class) | |
@ResponseBody | |
Complex handleAll(Throwable ex) { | |
return new Complex(); | |
} | |
@Data | |
public static class Complex { | |
String something; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
compile('org.springframework.boot:spring-boot-starter-webflux') | |
compileOnly('org.projectlombok:lombok') | |
testCompile('org.springframework.boot:spring-boot-starter-test') | |
testCompile('io.projectreactor:reactor-test') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment