-
Notifications
You must be signed in to change notification settings - Fork 1
Description
printStackTrace yerine hatayı daha anlaşılır şekilde loglamak gerektiğini söylüyolar. Sadece printStackTrace de değil tabiki.
e.printStackTrace() is generally discouraged because it just prints out the stack trace to standard error. Because of this you can't really control where this output goes.
The better thing to do is to use a logging framework (logback, slf4j, java.util.logging, log4j, etc) because then you can control where the errors are logged to and what the log retention policy is.
And generally you'll want to catch the exception and if it's unexpected behavior, log it and either throw a new exception (probably specific to your application) or do whatever you have to do to continue operating gracefully.
https://sonar43.spring.io/rules/show/squid:S1166?layout=false
-- SonarQube