Modified error message and code for authentication failure (#5810)
This commit is contained in:
parent
4f42c29f95
commit
597033e623
|
|
@ -25,6 +25,8 @@ public enum AppsmithPluginError {
|
|||
AppsmithErrorAction.LOG_EXTERNALLY, "Datasource configuration is invalid"),
|
||||
PLUGIN_DATASOURCE_TIMEOUT_ERROR(504, 5008, "{0}", AppsmithErrorAction.DEFAULT, "Timed out when connecting to " +
|
||||
"datasource"),
|
||||
PLUGIN_AUTHENTICATION_ERROR(401, 4000, "Invalid authentication credentials. Please check datasource configuration.",
|
||||
AppsmithErrorAction.DEFAULT, "Datasource authentication error"),
|
||||
;
|
||||
|
||||
private final Integer httpErrorCode;
|
||||
|
|
|
|||
|
|
@ -85,9 +85,7 @@ public class OAuth2 extends AuthenticationDTO {
|
|||
@Override
|
||||
public Mono<Boolean> hasExpired() {
|
||||
if (this.authenticationResponse == null) {
|
||||
return Mono.error(new AppsmithPluginException(
|
||||
AppsmithPluginError.PLUGIN_ERROR,
|
||||
"Expected datasource to have valid authentication tokens at this point"));
|
||||
return Mono.error(new AppsmithPluginException(AppsmithPluginError.PLUGIN_AUTHENTICATION_ERROR));
|
||||
}
|
||||
|
||||
if (this.authenticationResponse.expiresAt == null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user