Fix even more EngineInformation startup exceptions

This commit is contained in:
JeremyStar™ 2024-06-28 18:31:28 +02:00
parent 1a42e4bbc6
commit 7c21503532
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 15 additions and 6 deletions

View file

@ -401,7 +401,10 @@ public final class EngineInformation {
gitProperties.load(gitStream);
gitStream.close();
} catch (IOException exception) {
logger.crash("Unable to load build information: InputStream 'gitStream' failed", exception);
StackTraceParser parser = new StackTraceParser(exception);
System.out.println("Unable to load build information: InputStream 'gitStream' failed");
System.out.println(parser.getHeader() + "\n" + parser.getStackTrace());
Engine.getInstance().shutdown(69);
return;
}
}
@ -434,8 +437,12 @@ public final class EngineInformation {
GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(date);
gitCommitTime = calendar.toZonedDateTime();
} catch (ParseException e) {
logger.crash("Unable to load build information: Can't parse \"" + gitParser.getString("git.commit.time") + "\" using format \"yyyy-MM-dd'T'HH:mmZ\"");
} catch (ParseException exception) {
StackTraceParser parser = new StackTraceParser(exception);
System.out.println("Unable to load build information: Can't parse \"" + gitParser.getString("git.commit.time") + "\" using format \"yyyy-MM-dd'T'HH:mmZ\"");
System.out.println(parser.getHeader() + "\n" + parser.getStackTrace());
Engine.getInstance().shutdown(69);
return;
}
gitCommitterName = gitParser.getString("git.commit.user.name");
gitCommitterEmail = gitParser.getString("git.commit.user.email");

View file

@ -22,17 +22,19 @@ package de.staropensource.sosengine.base.logging;
import de.staropensource.sosengine.base.Engine;
import de.staropensource.sosengine.base.EngineConfiguration;
import de.staropensource.sosengine.base.classes.Placeholder;
import de.staropensource.sosengine.base.events.EngineCrashEvent;
import de.staropensource.sosengine.base.logging.placeholders.crashhandler.*;
import de.staropensource.sosengine.base.classes.logging.LogIssuer;
import de.staropensource.sosengine.base.classes.logging.LogLevel;
import de.staropensource.sosengine.base.events.EngineCrashEvent;
import de.staropensource.sosengine.base.logging.placeholders.crashhandler.*;
import de.staropensource.sosengine.base.utility.PlaceholderEngine;
import lombok.Getter;
import lombok.Setter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
/**
* Handles engine and application crashes.