diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java')
-rw-r--r-- | openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java index 05eae9d7e5..8096b4d7a5 100644 --- a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java @@ -13,31 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.common.errors; import org.apache.commons.text.RandomStringGenerator; public class GeneralErrorBuilder { - private static final String GENERAL_ERROR_REST_ID = "GENERAL_ERROR_REST_ID"; - private static final String GENERAL_ERROR_REST_MSG = - "An internal error has occurred. Please contact support. Error ID: %s"; - - private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); - - /** - * Instantiates a new General error builder. - */ - public GeneralErrorBuilder() { - RandomStringGenerator generator = new RandomStringGenerator.Builder().withinRange('A', 'Z').build(); - builder.withId(GENERAL_ERROR_REST_ID); - builder.withCategory(ErrorCategory.APPLICATION); - builder.withMessage(String.format(GENERAL_ERROR_REST_MSG, generator.generate(8))); - } - - public ErrorCode build() { - return builder.build(); - } - + private static final String GENERAL_ERROR_REST_ID = "GENERAL_ERROR_REST_ID"; + private static final String GENERAL_ERROR_REST_MSG = "An internal error has occurred. Please contact support. Error ID: %s"; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new General error builder. + */ + public GeneralErrorBuilder() { + RandomStringGenerator generator = new RandomStringGenerator.Builder().withinRange('A', 'Z').build(); + builder.withId(GENERAL_ERROR_REST_ID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(GENERAL_ERROR_REST_MSG, generator.generate(8))); + } + + public ErrorCode build() { + return builder.build(); + } } |