New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FullAjaxExceptionHandler ignoring the parameter org.omnifaces.EXCEPTION_TYPES_TO_UNWRAP #333

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

Comments

Projects
None yet
2 participants
@julianomqs

julianomqs commented Dec 14, 2016

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 referenced this issue Dec 14, 2016

Closed

#333 #334

BalusC added a commit that referenced this issue Dec 17, 2016

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Dec 17, 2016

Member

Whoops, fixed, thank you for reporting!

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