summaryrefslogtreecommitdiffstats
path: root/models-errors
diff options
context:
space:
mode:
Diffstat (limited to 'models-errors')
-rw-r--r--models-errors/pom.xml36
-rw-r--r--models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponseUtils.java10
2 files changed, 39 insertions, 7 deletions
diff --git a/models-errors/pom.xml b/models-errors/pom.xml
index 96f417e4a..33ef027dd 100644
--- a/models-errors/pom.xml
+++ b/models-errors/pom.xml
@@ -1,6 +1,6 @@
<!--
============LICENSE_START=======================================================
- Copyright (C) 2019, 2023 Nordix Foundation.
+ Copyright (C) 2019, 2023-2024 Nordix Foundation.
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,9 +34,41 @@
<description>The models for Policy API's to return Error/warning message details.</description>
<dependencies>
<dependency>
- <groupId>org.onap.policy.common</groupId>
+ <groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
<version>${policy.common.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils-test</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.openpojo</groupId>
+ <artifactId>openpojo</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
</project>
diff --git a/models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponseUtils.java b/models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponseUtils.java
index 749651310..e571e4058 100644
--- a/models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponseUtils.java
+++ b/models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponseUtils.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -42,14 +42,14 @@ public final class ErrorResponseUtils {
public static void getExceptionMessages(final ErrorResponse errorResponse, final Throwable throwable) {
errorResponse.setErrorMessage(throwable.getMessage());
- List<String> cascascadedErrorMessages = new ArrayList<>();
+ List<String> cascadedErrorMessages = new ArrayList<>();
for (var t = throwable; t != null; t = t.getCause()) {
- cascascadedErrorMessages.add(t.getMessage());
+ cascadedErrorMessages.add(t.getMessage());
}
- if (!cascascadedErrorMessages.isEmpty()) {
- errorResponse.setErrorDetails(cascascadedErrorMessages);
+ if (!cascadedErrorMessages.isEmpty()) {
+ errorResponse.setErrorDetails(cascadedErrorMessages);
}
}
}