Project

EarthSciAST

The EarthSciML Abstract Syntax Tree format: schema, operators, coupling, and five language bindings.

Contents

This is the documentation for the older version v0.16.0. For the latest release, see v0.17.0.

unit_conversion_error

Stable error · Units

Tier: stable · Kind: error · Topic: Units

JuliaTypeScriptPythonRustGo
UnitConversionErrorUnitConversionErrorUnitConversionErrornot exportednot exported

Julia

struct UnitConversionError <: EarthSciASTError
UnitConversionError(code::String, message::String)
UnitConversionError(code, message)
UnitConversionError(message::AbstractString)
UnitConversionError <: EarthSciASTError

A unit_conversion that cannot be parsed or applied. Fields: code (unit_error, the code TypeScript’s UnitConversionError carries) and message.

UnitConversionError(message)

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.