summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/CreateToscaObjectErrorBuilder.java
blob: f9a3da2e750f7eede274d9999c47e28963deaac9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package org.openecomp.core.converter.errors;

import org.openecomp.sdc.common.errors.BaseErrorBuilder;
import org.openecomp.sdc.common.errors.ErrorCategory;

public class CreateToscaObjectErrorBuilder extends BaseErrorBuilder {
  private static final String CANT_CREATE_OBJECT_FROM_CLASS =
      "Can't create %s from %s. Reason - %s";
  private static final String IMPORT_TOSCA = "IMPORT_TOSCA";

  public CreateToscaObjectErrorBuilder(String className,
                                       String objectId,
                                       String reason) {
    getErrorCodeBuilder()
        .withId(IMPORT_TOSCA)
        .withCategory(ErrorCategory.APPLICATION)
        .withMessage(String.format(CANT_CREATE_OBJECT_FROM_CLASS, className, objectId, reason));
  }
}