Fix ReCaptha NPE
Improve error handling when permission are removed.
This commit is contained in:
@@ -18,11 +18,21 @@
|
||||
|
||||
package com.wisemapping.exceptions;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class AccessDeniedSecurityException
|
||||
extends Exception
|
||||
extends ClientException
|
||||
{
|
||||
public AccessDeniedSecurityException(String msg)
|
||||
public static final String MSG_KEY = "ACCESS_HAS_BEEN_REVOKED";
|
||||
|
||||
public AccessDeniedSecurityException(@NotNull String msg)
|
||||
{
|
||||
super(msg);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected String getMsgBundleKey() {
|
||||
return MSG_KEY;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,20 @@
|
||||
package com.wisemapping.exceptions;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.context.MessageSource;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
abstract public class ClientException extends WiseMappingException {
|
||||
public ClientException(@NotNull String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
protected abstract
|
||||
@NotNull
|
||||
String getMsgBundleKey();
|
||||
|
||||
public String getMessage(@NotNull final MessageSource messageSource, final @NotNull Locale locale) {
|
||||
return messageSource.getMessage(this.getMsgBundleKey(), null, locale);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user