Do not log exception when there is no environment.properties
See original GitHub issueWhen we don’t have a environment.properties
file, VRaptor latest version is logging:
WARN [http-bio-8080-exec-1] (DefaultEnvironment.java:103) - Could not find the file environment.properties to load.
java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:434)
at java.util.Properties.load0(Properties.java:353)
at java.util.Properties.load(Properties.java:341)
at br.com.caelum.vraptor.environment.DefaultEnvironment.loadAndPut(DefaultEnvironment.java:100)
at br.com.caelum.vraptor.environment.DefaultEnvironment.getProperties(DefaultEnvironment.java:82)
at br.com.caelum.vraptor.environment.DefaultEnvironment.has(DefaultEnvironment.java:168)
at br.com.caelum.vraptor.environment.DefaultEnvironment.get(DefaultEnvironment.java:173)
We should only log the warn message and not the exception. This could led users to think that it’s a unexpected behaviour.
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Spring 3.1 @PropertySources does not throw Exception if ...
If the property is not found a java.lang.IllegalStateException is thrown. Share.
Read more >26. Logging - Spring
Since logging is initialized before the ApplicationContext is created, it is not possible to control logging from @PropertySources in Spring @Configuration ...
Read more >Do not print stack trace when environment variables access is ...
This issue is a security issue. When running log4j in a restricted environment where the calling application is not allowed to access environment...
Read more >Logging Exceptions in Java - Loggly
A look at common approaches to exception handling and logging in Java. The examples use Log4j2, but the concepts apply to many modern ......
Read more >Handle errors in ASP.NET Core Blazor apps - Microsoft Learn
Discover how ASP.NET Core Blazor manages unhandled exceptions and how to develop apps that detect and handle errors.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
está feito! em algumas horas o 4.2.1 já deve estar disponível no repositório do maven
AEWWWWWWWWWWWWWWWWWWWWW brigadão 😉