code:     private static ErrorPage findErrorPage
          (Context context, Throwable exception) {
  
          if (exception == null) {
              return (null);
          }
          Class<?> clazz = exception.getClass();
          String name = clazz.getName();
          while (!Object.class.equals(clazz)) {
              ErrorPage errorPage = context.findErrorPage(name);
              if (errorPage != null) {
                  return (errorPage);
              }
              clazz = clazz.getSuperclass();
              if (clazz == null) {
                  break;
              }
              name = clazz.getName();
          }
          return (null);
  
      }
  