Package br.gov.frameworkdemoiselle.exception

Examples of br.gov.frameworkdemoiselle.exception.ApplicationException.severity()


  }

  private void handleException(Throwable cause) throws Exception {
    ApplicationException ann = cause.getClass().getAnnotation(ApplicationException.class);

    if (ann == null || SeverityType.FATAL == ann.severity()) {
      throw (cause instanceof Exception ? (Exception) cause : new Exception(cause));

    } else {
      switch (ann.severity()) {
        case INFO:
View Full Code Here


    if (ann == null || SeverityType.FATAL == ann.severity()) {
      throw (cause instanceof Exception ? (Exception) cause : new Exception(cause));

    } else {
      switch (ann.severity()) {
        case INFO:
          getLogger().info(cause.getMessage());
          break;

        case WARN:
View Full Code Here

  }

  private void handleException(Throwable cause) throws Exception {
    ApplicationException ann = cause.getClass().getAnnotation(ApplicationException.class);

    if (ann == null || SeverityType.FATAL == ann.severity()) {
      throw (cause instanceof Exception ? (Exception) cause : new Exception(cause));

    } else {
      switch (ann.severity()) {
        case INFO:
View Full Code Here

    if (ann == null || SeverityType.FATAL == ann.severity()) {
      throw (cause instanceof Exception ? (Exception) cause : new Exception(cause));

    } else {
      switch (ann.severity()) {
        case INFO:
          getLogger().info(cause.getMessage());
          break;

        case WARN:
View Full Code Here

  }

  private void handleException(Throwable cause) throws Throwable {
    ApplicationException ann = cause.getClass().getAnnotation(ApplicationException.class);

    if (ann == null || SeverityType.FATAL == ann.severity()) {
      throw cause;

    } else {
      switch (ann.severity()) {
        case INFO:
View Full Code Here

    if (ann == null || SeverityType.FATAL == ann.severity()) {
      throw cause;

    } else {
      switch (ann.severity()) {
        case INFO:
          getLogger().info(cause.getMessage());
          break;

        case WARN:
View Full Code Here

  public static FacesMessage parse(final Throwable throwable) {
    FacesMessage facesMessage = new FacesMessage();
    ApplicationException annotation = throwable.getClass().getAnnotation(ApplicationException.class);

    if (annotation != null) {
      facesMessage.setSeverity(parse(annotation.severity()));
    } else {
      facesMessage.setSeverity(SEVERITY_ERROR);
    }

    if (throwable.getMessage() != null) {
View Full Code Here

  public static FacesMessage parse(final Throwable throwable) {
    FacesMessage facesMessage = new FacesMessage();
    ApplicationException annotation = throwable.getClass().getAnnotation(ApplicationException.class);

    if (annotation != null) {
      facesMessage.setSeverity(parse(annotation.severity()));
    } else {
      facesMessage.setSeverity(SEVERITY_ERROR);
    }

    if (throwable.getMessage() != null) {
View Full Code Here

  }

  private void handleException(Throwable cause) throws Exception {
    ApplicationException ann = cause.getClass().getAnnotation(ApplicationException.class);

    if (ann == null || SeverityType.FATAL == ann.severity()) {
      throw (cause instanceof Exception ? (Exception) cause : new Exception(cause));

    } else {
      switch (ann.severity()) {
        case INFO:
View Full Code Here

    if (ann == null || SeverityType.FATAL == ann.severity()) {
      throw (cause instanceof Exception ? (Exception) cause : new Exception(cause));

    } else {
      switch (ann.severity()) {
        case INFO:
          getLogger().info(cause.getMessage());
          break;

        case WARN:
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.