If we print an InputException, it does not print the message. InputException extends KiteException extends Throwable. The toString() of Throwable calls its getMessage() which uses the field detailMessage. However, KiteException defines its own message field, in which the message is stored, but does not override the getMessage() to use it, hence getMessage() , referring to Throwable.detailMessage returns null. This needs to be fixed. The workaround is simple : message is a public field in KiteException, and so, can be accessed directly.
To better understand the scenario, we need to identify the specific case in which the null message is being returned. Please use the e.printStackTrace() method to print the complete stack trace, which will provide detailed information about where the exception occurred along with the full error context.
Its not a specific scenario, getMessage() will always return null for any KiteException, because of the different instance vars in the classes, as i have detailed above. Due to this, toString() too, will not contain the message we passed to the constructor.
@manojmo, For now you can access the exception message as mentioned here in the sample code. In future releases we will make changes in the Kite Exception class to call super with message parameter and that should solve the issue.
e.printStackTrace()method to print the complete stack trace, which will provide detailed information about where the exception occurred along with the full error context.For now you can access the exception message as mentioned here in the sample code.
In future releases we will make changes in the Kite Exception class to call super with message parameter and that should solve the issue.