Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In case of events logged due to an error occurred while processing a job or change of state of a resource , a detailed error message describing the reason of failure would be logged into the error_message field of the event. Based on who the user is an admin or a normal user relevant error message would be shown to the end user.

How would error_message data be filled?

Currently, the error messages are ignored in case of any exceptions while a job is performed. The event interceptors in case of error log error events with the hard coded description provided in the event files.

Code Block
public class ActionEventInterceptor implements ComponentMethodInterceptor, MethodInterceptor {
...
 
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
    ...
    try {
        interceptorData = interceptStart(m, target);
        Object result = invocation.proceed();
        success = true;
        return result;
    } finally {
        if (success) {
            interceptComplete(m, target, interceptorData);
        } else {
            interceptException(m, target, interceptorData);
        }
    }
...

A catch error block would help to have descriptive error messages, instead of displaying short un-descriptive event descriptions in case of error events.

Externalize the event descriptions strings

...