Class List Method List File List

# Class: VertxWeb::ErrorHandler

Inherits:
  Object
  - Object
  - VertxWeb::ErrorHandler
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/error_handler.rb

## Overview

A pretty error handler for rendering error pages.

## Class Method Summary (collapse)

- + (::VertxWeb::ErrorHandler) create(param_1 = nil, param_2 = nil)
  Create an error handler.

## Instance Method Summary (collapse)

- - (void) handle(arg0 = nil)

## Class Method Details

### + (`::VertxWeb::ErrorHandler`) create + (`::VertxWeb::ErrorHandler`) create(displayExceptionDetails) + (`::VertxWeb::ErrorHandler`) create(errorTemplateName) + (`::VertxWeb::ErrorHandler`) create(errorTemplateName, displayExceptionDetails)

Create an error handler

Overloads:

- + (`::VertxWeb::ErrorHandler`) create(displayExceptionDetails)

  Parameters:

  - displayExceptionDetails (`true`, `false`) —
    true if exception details should be displayed
- + (`::VertxWeb::ErrorHandler`) create(errorTemplateName)

  Parameters:

  - errorTemplateName (`String`) —
    the error template name - will be looked up from the classpath
- + (`::VertxWeb::ErrorHandler`) create(errorTemplateName, displayExceptionDetails)

  Parameters:

  - errorTemplateName (`String`) —
    the error template name - will be looked up from the classpath
  - displayExceptionDetails (`true`, `false`) —
    true if exception details should be displayed

Returns:

- (`::VertxWeb::ErrorHandler`) —
  the handler

Raises:

- (`ArgumentError`)

    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/error_handler.rb', line 35

    def self.create(param_1=nil,param_2=nil)
      if !block_given? && param_1 == nil && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::ErrorHandler.java_method(:create, []).call(),::VertxWeb::ErrorHandler)
      elsif (param_1.class == TrueClass || param_1.class == FalseClass) && !block_given? && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::ErrorHandler.java_method(:create, [Java::boolean.java_class]).call(param_1),::VertxWeb::ErrorHandler)
      elsif param_1.class == String && !block_given? && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::ErrorHandler.java_method(:create, [Java::java.lang.String.java_class]).call(param_1),::VertxWeb::ErrorHandler)
      elsif param_1.class == String && (param_2.class == TrueClass || param_2.class == FalseClass) && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::ErrorHandler.java_method(:create, [Java::java.lang.String.java_class,Java::boolean.java_class]).call(param_1,param_2),::VertxWeb::ErrorHandler)
      end
      raise ArgumentError, "Invalid arguments when calling create(param_1,param_2)"
    end

## Instance Method Details

### - (`void`) handle(arg0 = nil)

This method returns an undefined value.

Parameters:

- arg0 (`::VertxWeb::RoutingContext`) (defaults to: `nil`)

Raises:

- (`ArgumentError`)

    19
    20
    21
    22
    23
    24
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/error_handler.rb', line 19

    def handle(arg0=nil)
      if arg0.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:handle, [Java::IoVertxExtWeb::RoutingContext.java_class]).call(arg0.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling handle(arg0)"
    end