mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-28 19:05:53 +00:00
Minor secret utils error log (#18856)
* fix: pass exception message in SecretUtils.convert * fix: pass throwable
This commit is contained in:
parent
04dfbc2257
commit
fc01035ce5
@ -12,6 +12,10 @@ public class InvalidServiceConnectionException extends WebServiceException {
|
||||
super(Response.Status.BAD_REQUEST, ERROR_TYPE, message);
|
||||
}
|
||||
|
||||
public InvalidServiceConnectionException(String message, Throwable e) {
|
||||
super(Response.Status.BAD_REQUEST, ERROR_TYPE, message, e);
|
||||
}
|
||||
|
||||
private InvalidServiceConnectionException(Response.Status status, String message) {
|
||||
super(status, ERROR_TYPE, message);
|
||||
}
|
||||
|
@ -78,17 +78,20 @@ public final class SecretsUtil {
|
||||
return ClassConverterFactory.getConverter(clazz).convert(connectionConfig);
|
||||
} catch (Exception e) {
|
||||
// If we have the name we are trying to encrypt a connection
|
||||
String message = e.getMessage();
|
||||
if (connectionName != null) {
|
||||
throw new InvalidServiceConnectionException(
|
||||
String.format(
|
||||
"Failed to convert [%s] to type [%s]. Review the connection.",
|
||||
connectionName, connectionType));
|
||||
"Failed to convert [%s] to type [%s]. Review the connection.\n%s",
|
||||
connectionName, connectionType, message),
|
||||
e);
|
||||
}
|
||||
// If we don't have the name, we are decrypting from the db
|
||||
throw new InvalidServiceConnectionException(
|
||||
String.format(
|
||||
"Failed to load the connection of type [%s]. Did migrations run properly?",
|
||||
connectionType));
|
||||
"Failed to load the connection of type [%s]. Did migrations run properly?\n%s",
|
||||
connectionType, message),
|
||||
e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user