txt: ## cannotconvert.md
  class X::Numeric::CannotConvert
  
  Error while trying to coerce a number to another type
  
  ```raku
  class X::Numeric::CannotConvert is Exception { }
  ```
  
  Occurs when an attempt to coerce an [`Inf`](/type/Num#Inf) or a [`NaN`](/type/Num#NaN) to a [`Numeric`](/type/Numeric) type.
  
  For example
  
  ```raku
  say Inf.Int;
  CATCH { default { put .^name, ': ', .Str } };
  # OUTPUT: «X::Numeric::CannotConvert: Cannot convert Inf to Int␤»
  ```
  
  Most other conversion errors throw [`X::Numeric::Real`](/type/X/Numeric/Real).
  
  # [Methods](#class_X::Numeric::CannotConvert "go to top of document")[§](#Methods "direct link")
  
  ## [method source](#class_X::Numeric::CannotConvert "go to top of document")[§](#method_source "direct link")
  
  ```raku
  method source()
  ```
  
  Returns the value that failed to coerce.
  
  ## [method target](#class_X::Numeric::CannotConvert "go to top of document")[§](#method_target "direct link")
  
  ```raku
  method target()
  ```
  
  Returns the type to which the coercion was attempted.
  
  ## [method reason](#class_X::Numeric::CannotConvert "go to top of document")[§](#method_reason "direct link")
  
  ```raku
  method reason(--> Str:D)
  ```
  
  Returns the reason that the conversion failed.
  