1

When setting up a template, if the attribute keys are not set into the ST object it throws the error :

         context [anonymous] 11:27 attribute  isn't defined

is there any way to suppress this error or flag to not to show error in logs.i'm using log4j to log my log is filed with attribute isn't defined error what should i do remove this from log?

salauddin
  • 113
  • 8

1 Answers1

1

You could write your own STErrorListener or use ErrorBuffer to catch the errors and then iterate over the error messages and decide if you want to write it to the log or not depending its type.

danielsepulvedab
  • 676
  • 1
  • 11
  • 22
  • Thank You. I feel this needs an STGroup (stGroup.errMgr=...) , for ST directly, I've not found a way to add an errorListener, unfortunatelly – Hartmut Pfarr Jun 09 '17 at 19:40
  • UPDATE: even with ST there can an ErrorHandler be added. Just construct the ST with an Group, which points to an error handler - C'est tout! :) – Hartmut Pfarr Jun 09 '17 at 19:56
  • 1
    new ErrorManager(new STErrorListener() { @Override public void runTimeError(STMessage msg) { if (msg.error == ErrorType.NO_SUCH_ATTRIBUTE) ... }; ... } – Hartmut Pfarr Jun 09 '17 at 20:42