FullAjaxExceptionHandler ignoring the parameter org.omnifaces.EXCEPTION_TYPES_TO_UNWRAP #333

Closed
julianomqs opened this Issue Dec 14, 2016 · 1 comment

Projects

None yet

2 participants

@julianomqs
julianomqs commented Dec 14, 2016 edited

Hello,

I'm using FullAjaxExceptionHandler and I ran into a problem:

FullAjaxExceptionHandler ignoring the parameter org.omnifaces.EXCEPTION_TYPES_TO_UNWRAP.

This happens because line 333 of method parseExceptionTypesParam:

@SuppressWarnings("unchecked")
	private static Class<? extends Throwable>[] parseExceptionTypesParam(ServletContext context, String paramName, Set<Class<? extends Throwable>> defaults) {
		Set<Class<? extends Throwable>> types = new HashSet<>();

		if (defaults != null) {
			types.addAll(defaults);
		}

               // Problem is the line below		
               String typesParam = context.getInitParameter(PARAM_NAME_EXCEPTION_TYPES_TO_IGNORE_IN_LOGGING);

		if (!isEmpty(typesParam)) {
			for (String typeParam : typesParam.split("\\s*,\\s*")) {
				try {
					types.add((Class<? extends Throwable>) Class.forName(typeParam));
				}
				catch (ClassNotFoundException e) {
					throw new IllegalArgumentException(
						String.format(ERROR_INVALID_EXCEPTION_TYPES_PARAM_CLASS, paramName, typeParam), e);
				}
			}
		}

		return types.toArray(new Class[types.size()]);
	}

As you can see, the parameter paramName is being ignored and PARAM_NAME_EXCEPTION_TYPES_TO_IGNORE_IN_LOGGING is fixed.

I ran WildFly in debug mode, and checked FullAjaxExceptionHandler class, the exceptionTypesToUnwrap array always have the default values, FacesException and ELException.

I forked and made the change, tested and it solved the problem, so I created the PR #334.

Can you take a look, and if possible, make a hotfix release to solve this problem, please?

@julianomqs julianomqs pushed a commit to julianomqs/omnifaces that referenced this issue Dec 14, 2016
Juliano Marques #333 e33faeb
@julianomqs julianomqs referenced this issue Dec 14, 2016
Closed

#333 #334

@BalusC BalusC added a commit that referenced this issue Dec 17, 2016
@BalusC BalusC #333 Fix refactoring mistake 9c4c676
@BalusC
Member
BalusC commented Dec 17, 2016

Whoops, fixed, thank you for reporting!

@BalusC BalusC closed this Dec 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment