errors

world.money.errors
object errors

Defines the hierarchy of errors for money-related operations.

This object provides a central location for all error types that can be returned by the library, including those related to arithmetic, formatting, currency validation, and currency conversion.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
errors.type

Members list

Type members

Classlikes

final case class ArithmeticError extends MoneyError

Returned when an arithmetic operation on monetary values fails.

Returned when an arithmetic operation on monetary values fails.

This can occur, for example, during a division by zero.

Value parameters

cause

The optional underlying Throwable (e.g., java.lang.ArithmeticException).

message

An explanation of the arithmetic error.

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait MoneyError
trait NoStackTrace
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Container for specific ConversionError types.

Container for specific ConversionError types.

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ConversionError extends MoneyError

A base type for all errors related to currency conversion.

A base type for all errors related to currency conversion.

Attributes

Companion
object
Supertypes
trait MoneyError
trait NoStackTrace
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
object CurrencyError

Container for specific CurrencyError types.

Container for specific CurrencyError types.

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait CurrencyError extends MoneyError

A base type for errors related to currency validation and lookup.

A base type for errors related to currency validation and lookup.

Attributes

Companion
object
Supertypes
trait MoneyError
trait NoStackTrace
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
final case class InternalError extends MoneyError

Returned when an unexpected internal error occurs within the money module.

Returned when an unexpected internal error occurs within the money module.

This error typically signifies a logic flaw or an inconsistent state that should not be encountered during normal programme execution.

Value parameters

cause

An optional underlying Throwable that caused this error.

message

A description of the internal error.

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait MoneyError
trait NoStackTrace
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
object InternalError

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait MoneyError extends Throwable, NoStackTrace

A root error for all operations in the world.money module.

A root error for all operations in the world.money module.

It extends scala.util.control.NoStackTrace to improve performance by avoiding stack trace generation for errors used in control flow.

Attributes

Supertypes
trait NoStackTrace
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
final case class NumberFormattingError extends MoneyError

Returned when a String cannot be parsed into a numeric representation.

Returned when a String cannot be parsed into a numeric representation.

This error is returned by factories like world.money.currency.CurrencyValue$.fromString.

Value parameters

cause

An optional underlying Throwable, typically a NumberFormatException.

message

A description of the formatting or parsing error.

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait MoneyError
trait NoStackTrace
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type