Version: dev

unit_conversion_error

Stable error · Units

Tier: stable · Kind: error · Topic: Units

JuliaTypeScriptPythonRustGo
UnitConversionErrorUnitConversionErrorUnitConversionErrornot exportednot exported

Julia

struct UnitConversionError <: EarthSciASTError
UnitConversionError(msg::String)
UnitConversionError(msg)

A unit_conversion that cannot be parsed or applied.

Source

TypeScript

class UnitConversionError extends EsmDiagnosticError
new UnitConversionError(message: string): UnitConversionError

Error thrown when a unit string cannot be parsed (unknown unit name, malformed number or exponent, unbalanced parentheses, trailing input) or when convertUnits is asked to convert between incompatible dimensions. code is always unit_error (ERROR_CODES .UNIT_ERROR); the message names the offending unit string.

Source

Python

class UnitConversionError(EarthSciAstError, ValueError)

Raised when unit_conversion cannot be applied.

Source

Rust

Rust does not export this error.

Go

Go does not export this error.