module CrystGLFW::Error

Overview

The Error module encapsulates the handful of GLFW Error types and provides a unified generator for them.

Defined in:

crystglfw/errors/any.cr
crystglfw/errors/api_unavailable.cr
crystglfw/errors/error.cr
crystglfw/errors/format_unavailable.cr
crystglfw/errors/invalid_enum.cr
crystglfw/errors/invalid_value.cr
crystglfw/errors/joystick_not_connected.cr
crystglfw/errors/key_not_printable.cr
crystglfw/errors/no_current_context.cr
crystglfw/errors/no_window_context.cr
crystglfw/errors/not_full_screen.cr
crystglfw/errors/not_initialized.cr
crystglfw/errors/out_of_memory.cr
crystglfw/errors/platform_error.cr
crystglfw/errors/version_unavailable.cr

Class Method Summary

Class Method Detail

def self.generate(error_code : Int32) : Error::Any #

:nodoc:

Returns an instance of a subclass of Error::Any based on the given error code.

CrystGLFW.on_error do |error_code|
  raise Error.generate error_code # Raises a specific type of exception determined by the error code.
end

This method accepts the following arguments:

  • error_code, the code yielded by `CrystGLFW#on_error'

NOTE This method may be called outside a CrystGLFW#run block definition.


[View source]
def self.generate(error_label : Symbol) : Error::Any #

:nodoc

Returns an instance of a subclass of Error::Any based on the given error label.

This method accepts the following arguments:

  • error_label, the label to reference the type of Error.

NOTE This method may be called oustside a CrystGLFW#run block definition.


[View source]