unit_conversion_error
Stable error · Units
Tier: stable · Kind: error · Topic: Units
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
UnitConversionError | UnitConversionError | UnitConversionError | not exported | not exported |
Julia
struct UnitConversionError <: EarthSciASTError
UnitConversionError(msg::String)
UnitConversionError(msg)
A unit_conversion that cannot be parsed or applied.
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.
Python
class UnitConversionError(EarthSciAstError, ValueError)
Raised when unit_conversion cannot be applied.
Rust
Rust does not export this error.
Go
Go does not export this error.