-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
Hi all,
Now I have made some constraint with java code. Everything works great. There is just one thing that bothers me.
We throw a new WrongValueException(Component comp, String message);
Now in mine logging I can see this and it comes from :
org.zkoss.bind.impl.ParamCall:117
The method of that class :
public void call(Object base, Method method) {
Class<?>[] paramTypes = method.getParameterTypes();
java.lang.annotation.Annotation[][] parmAnnos = method.getParameterAnnotations();
Object[] params = new Object[paramTypes.length];
try {
for (int i = 0; i < paramTypes.length; i++) {
params[i] = resolveParameter(parmAnnos[i],paramTypes[i]);
}
method.invoke(base, params);
} catch(InvocationTargetException invokEx){
//Ian YT Tsai (2012.06.20), while InvocationTargetException,
//using original exception is much meaningful.
Throwable c = invokEx.getCause();
if(c == null) c = invokEx;
_log.error(c); // line 117.
throw UiException.Aide.wrap(c);
} catch (Exception e) {
_log.error(e);
throw UiException.Aide.wrap(e);
}
}
Now this is for me NOT an error to be logged(user stupidity I don't log), and I don't want a complete stacktrace ruining mine log.
How can I fix this that mine log stays clean?
Greetz chill.
2 | No.2 Revision |
Hi all,
Now I have made some constraint with java code. Everything works great. There is just one thing that bothers me.
We throw a new WrongValueException(Component comp, String message);
Now in mine logging I can see this and it comes from :
org.zkoss.bind.impl.ParamCall:117
The method of that class :
public void call(Object base, Method method) {
Class<?>[] paramTypes = method.getParameterTypes();
java.lang.annotation.Annotation[][] parmAnnos = method.getParameterAnnotations();
Object[] params = new Object[paramTypes.length];
try {
for (int i = 0; i < paramTypes.length; i++) {
params[i] = resolveParameter(parmAnnos[i],paramTypes[i]);
}
method.invoke(base, params);
} catch(InvocationTargetException invokEx){
//Ian YT Tsai (2012.06.20), while InvocationTargetException,
//using original exception is much meaningful.
Throwable c = invokEx.getCause();
if(c == null) c = invokEx;
_log.error(c); // line 117.
throw UiException.Aide.wrap(c);
} catch (Exception e) {
_log.error(e);
throw UiException.Aide.wrap(e);
}
}
Now this is for me NOT an error to be logged(user stupidity I don't log), and I don't want a complete stacktrace ruining mine log.
How can I fix this that mine log stays clean?
Greetz chill.