class Phase::DimensionError

Overview

A DimensionError is raised when the dimensionality of a data type is incorrect for a given operation. For example, a method that will work on any matrix should raise a DimensionError when passed a 3D MultiIndexable - the shape values should not matter, only the dimension.

If you do not care about disambiguating between ShapeError and DimensionError, note that DimensionError is a subclass of ShapeError - so you only need to rescue ex : ShapeError and you'll catch both kinds.

Defined in:

exceptions/exceptions.cr

Class Method Summary

Class methods inherited from class Phase::ShapeError

initialize(message : String | Nil = nil) initialize

Class Method Detail

def self.initialize(message : String | Nil = nil) #

[View source]