-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve diagnose for invalide environment/command line arguments #19
improve diagnose for invalide environment/command line arguments #19
Conversation
} | ||
|
||
String argFile = metaConfig.configFile; | ||
|
||
File file; | ||
if (argFile != null && !argFile.isBlank()) { | ||
if ("none".equals(argFile.toLowerCase())) { | ||
if ("none".equalsIgnoreCase(argFile)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gute Idee - wird das an anderen Stellen der Konfigurationsverarbeitung eigentlich auch so gemacht?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aktuell wird in phoneblock recordings
noch nur mit equals geprüft und die Methode getConfigFile
aus MetaConfig
ist auch noch nicht angepasst.
@@ -87,7 +93,7 @@ public static MetaConfig parseOptions(String[] args, String defaultConfigFile, O | |||
} | |||
} | |||
} else if (defaultConfigFile != null) { | |||
String fileName = System.getProperty("user.home") + "/" + defaultConfigFile; | |||
String fileName = System.getProperty("user.home") + File.pathSeparator + defaultConfigFile; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Top! Was für ein Anfängerfehler von mir....
LOG.warn("Reading options from: {}", file.getAbsolutePath()); | ||
} else { | ||
LOG.debug("Reading options from: {}", file.getAbsolutePath()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Das eigentliche Problem ist aber wohl, dass beim zweiten Durchlauf, wenn die Konfigurationsdatei gelesen wird, die Umgebungsvariablen komplett ignoriert werden. Die Argumente werden wieder hinzugefügt, die Umgebungsvariablen aber nicht.
3e10ba0 hier wurde nur der erste "Parse-Durchgang" angepasst, der zweite aber vergessen. |
Improved error messaging for read interruptions:
While working on haumacher/phoneblock#97, I noticed that it is currently difficult to identify the cause of interruptions when reading from environment variables or command-line arguments. To address this, I have added a warning to make these issues more transparent.
Added support for non-Linux systems:
Additionally, I implemented support for systems that use a different
pathSeparator
than Linux.