Commit 6fd8de2d249011591b2b0b72cbc796dcfd5ba444
1 parent
c3ddf670
Exists in
master
FWK-41: Correção no tratamento de exceções anotadas com
@ApplicationException
Showing
2 changed files
with
11 additions
and
1 deletions
Show diff stats
impl/extension/jsf/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/AbstractExceptionHandler.java
... | ... | @@ -80,7 +80,7 @@ public abstract class AbstractExceptionHandler extends ExceptionHandlerWrapper { |
80 | 80 | |
81 | 81 | protected abstract boolean handleException(final Throwable cause, FacesContext facesContext); |
82 | 82 | |
83 | - private Throwable getRoot(final Throwable throwable) { | |
83 | + protected Throwable getRoot(final Throwable throwable) { | |
84 | 84 | Throwable root = throwable; |
85 | 85 | |
86 | 86 | while (root.getCause() != null) { | ... | ... |
impl/extension/jsf/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/ApplicationExceptionHandler.java
... | ... | @@ -104,4 +104,14 @@ public class ApplicationExceptionHandler extends AbstractExceptionHandler { |
104 | 104 | } |
105 | 105 | return handled; |
106 | 106 | } |
107 | + | |
108 | + protected Throwable getRoot(final Throwable throwable) { | |
109 | + Throwable root = throwable; | |
110 | + | |
111 | + while (!Exceptions.isApplicationException(root)) { | |
112 | + root = root.getCause(); | |
113 | + } | |
114 | + | |
115 | + return root; | |
116 | + } | |
107 | 117 | } | ... | ... |