v9.1.0
envaptVariables

EnvaptErrorCodes

const EnvaptErrorCodes: object;

Numeric codes carried by EnvaptError.code. The hundreds digit groups them by failure: 1xx for fallbacks, 2xx for conversion and validation, 3xx for configuration and lookup.

Type Declaration

NameTypeDescription
ArrayElementConversionFailed206Thrown when an array element fails to convert to the array's element type.
ArrayFallbackElementTypeMismatch103Thrown when an array fallback mixes element types, or its elements do not match the array's element converter.
EmptyArrayElement207Thrown in strict mode when an array element is empty or whitespace only.
EnvFilesNotFound303Thrown when a listed env file does not exist.
FallbackConverterTypeMismatch104Thrown when a fallback does not match the type its built-in converter returns.
FileApiUnsupported306Thrown when a file API such as envPaths or baseDir runs on a source without files, or on the portable build with fileApiMode = 'throw'.
InvalidArrayConverterType201Thrown when an array converter is not a Converters.array() token, or its of is neither a built-in scalar nor a function.
InvalidBuiltInConverter202Thrown when a converter string is not one of the built-in tokens.
InvalidCustomConverter203Thrown when a converter is neither a built-in token nor a function.
InvalidEnvValue210Thrown when a required read gets a value it can't convert, a bad array element, or an error from a custom parser or schema. getRequiredAll throws it once for all bad values, schema fields included.
InvalidFallback101Thrown when an array converter gets a fallback that is not an array.
InvalidKeyInput304Thrown when the key list is empty, or a key is not a string or is blank.
InvalidMergedSource308Thrown when merge is called with no members, or with more than one filesystem-backed source.
InvalidUserDefinedConfig302Thrown when an option or setting has an invalid value, or combines options that cannot go together.
MalformedTimeFallback105Thrown when a time-string fallback does not match the <number><unit> format.
MissingDelimiter301Thrown when an array converter's delimiter is missing or an empty string.
MissingEnvValue305Thrown when a required value is missing or empty, or in strict mode when a ${VAR} can't resolve.
NoSourceBound307Thrown when an environment value is read before a source is bound with Envapter.useSource.
SchemaThrew209Thrown when a Standard Schema's validate throws in getAs or @Envapt({ schema }) without required. A required read reports it as an InvalidEnvValue issue.
SchemaValidationFailed208Thrown when getAs or @Envapt({ schema }) without required reads a value its Standard Schema rejects.

See

https://envapt.materwelon.dev/docs/errors#codes

On this page