All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.jhipster.lite.module.domain.npm.UnknownNpmPackageException Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
package tech.jhipster.lite.module.domain.npm;

import tech.jhipster.lite.shared.error.domain.GeneratorException;

public class UnknownNpmPackageException extends GeneratorException {

  public UnknownNpmPackageException(NpmPackageName packageName, NpmVersionSource source) {
    super(
      internalServerError(NpmErrorKey.UNKNOWN_PACKAGE)
        .message(buildMessage(packageName, source))
        .addParameter("packageName", packageName.get())
        .addParameter("packageSource", source.name())
    );
  }

  private static String buildMessage(NpmPackageName packageName, NpmVersionSource source) {
    return new StringBuilder()
      .append("Can't find ")
      .append(packageName.get())
      .append(" version in ")
      .append(source)
      .append(" package.json, forgot to add it?")
      .toString();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy