This commit is contained in:
kento2 2026-07-06 16:43:18 +02:00
parent 650f497a3e
commit 123f276b48
9 changed files with 128 additions and 71 deletions

View file

@ -5,6 +5,9 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor(access = AccessLevel.NONE)
public class EnvUtils {
/**
* @throws IllegalStateException if the var is not set
*/
public static String envOrThrow(String name) {
var env = System.getenv(name);
if (env == null) throw new IllegalStateException("environment variable " + name + " not set");