java - What exception to use for an improper use of annotation -


I am using an annotation which only makes sense on the final orbits (among other things). Although I am processing this annotation, I would like to throw an exception, which says that the class is not the last, so the combination of this annotation and this class does not have the meaning. Is there any exception to recommend using Oracle?

The matter you are interested in is a situation which the programmer has incorrectly placed an annotation That is, the text of the program is a buggy, a runtime exposure or a class from it will therefore be most appropriate.

This should be an unwanted exception, because the demand for the program can be an exception due to a bug in the program to catch an exception; There is no corrective action in the program, it may crash and the programmer can print a stack trace to help debug the problem, so you do not want to catch the exception.

There should be no code to hold exceptions to specific types, otherwise it does not matter which category the exception is. The name of the class provides some additional diagnostic information about the failure, you can reprint the current TypeConstraintException .


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -