Useful message about NullPointerException
We frequently see NullPointerException in our logs. It's really a big headache when we see a NullPointerException and it is encapsulated in another exception as we don't know which object is null and it is throwing an Exception. Is there any way we can get to know the object type or the object variable name where the object is null and it is throwing a NullPointerException? i.e, instead of just saying there is a NullPointerException, can we add some friendly message? For example, do you expect the error message like below? java.lang.NullPointerException : object with name "str" is null.
0 ANSWER
No answers available. You can post your answer below.
POST ANSWER
Sorry! You need to login first to post answer.
OR
Hello world on production |
By sonic0002 |
RECENT
- ► What does your personal desk look like?
- ► Happy Chinese New Year for those who celebrate it
- ► How much time do you code every day?
- ► What lies would programmers like to tell?
- ► Is GoLang being used in more and more startups?
- ► How do you feel about 996?
- ► What are your reasons not writing blogs?
- ► Why do you or do not write tech blogs?
- ► What weekend projects have you created?
- ► What's your opinion about Alibaba mooncake incident?