fixed exceptions
This commit is contained in:
parent
33327d5296
commit
93760fd7b7
@ -1,5 +1,8 @@
|
|||||||
package ru.dragonestia.picker.api.impl.exception;
|
package ru.dragonestia.picker.api.impl.exception;
|
||||||
|
|
||||||
|
import ru.dragonestia.picker.api.exception.ApiException;
|
||||||
|
|
||||||
|
@ApiException
|
||||||
public class AuthException extends RuntimeException {
|
public class AuthException extends RuntimeException {
|
||||||
|
|
||||||
public AuthException(String message) {
|
public AuthException(String message) {
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
package ru.dragonestia.picker.api.impl.exception;
|
package ru.dragonestia.picker.api.impl.exception;
|
||||||
|
|
||||||
|
import ru.dragonestia.picker.api.exception.ApiException;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ApiException
|
||||||
public class GraphqlException extends RuntimeException {
|
public class GraphqlException extends RuntimeException {
|
||||||
|
|
||||||
private final Map<String, String> details;
|
private final Map<String, String> details;
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
package ru.dragonestia.picker.api.impl.exception;
|
package ru.dragonestia.picker.api.impl.exception;
|
||||||
|
|
||||||
|
import ru.dragonestia.picker.api.exception.ApiException;
|
||||||
|
|
||||||
|
@ApiException
|
||||||
public class NotEnoughPermissions extends RuntimeException {
|
public class NotEnoughPermissions extends RuntimeException {
|
||||||
|
|
||||||
public NotEnoughPermissions(String message) {
|
public NotEnoughPermissions(String message) {
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
package ru.dragonestia.picker.api.impl.exception;
|
package ru.dragonestia.picker.api.impl.exception;
|
||||||
|
|
||||||
|
import ru.dragonestia.picker.api.exception.ApiException;
|
||||||
|
|
||||||
|
@ApiException
|
||||||
public class UnknownException extends RuntimeException {
|
public class UnknownException extends RuntimeException {
|
||||||
|
|
||||||
public UnknownException(String message) {
|
public UnknownException(String message) {
|
||||||
|
|||||||
@ -184,6 +184,7 @@ public class RestTemplate {
|
|||||||
|
|
||||||
var exceptionClass = response.header("X-Server-Exception");
|
var exceptionClass = response.header("X-Server-Exception");
|
||||||
var body = new String(Objects.requireNonNull(response.body()).bytes(), StandardCharsets.UTF_8);
|
var body = new String(Objects.requireNonNull(response.body()).bytes(), StandardCharsets.UTF_8);
|
||||||
|
System.out.println("EXCEPTION: " + exceptionClass + " " + body);
|
||||||
throw ExceptionService.prepare(exceptionClass, body);
|
throw ExceptionService.prepare(exceptionClass, body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user