githubEdit

Exceptions

BoxLang, like Java, has an exception hierarchy, in addition to the ability to declare custom runtime exceptionsarrow-up-right. The following are common exceptions thrown by the BoxLang Runtime.

chevron-rightScopeNotFoundExceptionhashtag

This exception is thrown when a scope is requested that does not exist in the current runtime build

This exception might be encountered, for example, in a non-web runtime when attempting to access web-specific scopes like URL or FORM

chevron-rightMissingIncludeExceptionhashtag

This exception is thrown when a an included template file cannot be located.

chevron-rightDatabaseExceptionhashtag

This exception is the base exception for all database-related errors in the BoxLang runtime.

chevron-rightConfigurationExceptionhashtag

This exception is thrown when an error is encountered during the configuration of the BoxLang runtime or its modules

chevron-rightNoFieldExceptionhashtag

This exception is thrown when a field is requested on a Java class that does not exist.

chevron-rightClassNotFoundBoxLangExceptionhashtag

This exception is thrown when a class cannot be found in the BoxLang runtime.

It is most often encountered when attempting to use a struct that has not been declared or is not avaialable in the current scope

chevron-rightLockExceptionhashtag

This exception is thrown when a locking operation fails - either with a failure to obtain the lock or due to a timeout

chevron-rightNoConstructorExceptionhashtag

This exception is thrown when no constructor is found on a Dynamic Object

It is most often encountered when attempting to construct a Java class with arguments that do not match any of the constructors

chevron-rightParseExceptionhashtag

This exception is encountered when parsing of a source file fails.

chevron-rightCustomExceptionhashtag

This is the base exception class for all custom exceptions thrown by the user.

All dynamically declared exceptions will extend this class

chevron-rightExpressionExceptionhashtag

This is the base exception for all expression or evaluation errors in the BoxLang runtime.

chevron-rightBoxRuntimeExceptionhashtag

This is the base exception thrown by the BoxLang runtime.

It is a runtime exception, so it does not need to be declared in the method signature of classes or methods which throw it

chevron-rightKeyNotFoundExceptionhashtag

The exception thrown when a key cannot be located within a struct

chevron-rightBoxIOExceptionhashtag

This exception is thrown when an IO operation fails.

The underlying Java IOException exception is parsed and is used to provide a more user-friendly message.

chevron-rightNoMethodExceptionhashtag

This exception is thrown when attempting to access a method on a java class that does not exist, is not accessible or does not match the arguments

chevron-rightBoxCastExceptionhashtag

This exception is thrown when an attempt to cast a value to a specific Java type fails.

Most often it is seen when strongly typed arguments or attributes are used in a way that is not compatible with the expected type.

chevron-rightAbstractClassExceptionhashtag

This exception is thrown when an abstract class is instantiated.

chevron-rightNoElementExceptionhashtag

This exception is thrown when a variable is accessed that does not exist

chevron-rightUnmodifiableExceptionhashtag

This exception is thrown when a modification attempt is made upon an unmodifiable (e.g.

final) object

chevron-rightBoxValidationExceptionhashtag

This is exception is thrown when an attempt to validate inbound attributes or arguments fails.

Validation upon these attributes or arguments is declared within the respective component or BIF.

Last updated

Was this helpful?