Caplin Trader 4.8.0

Class: module:caplin/core/Error

module:caplin/core/Error

Constructor

new module:caplin/core/Error(typeopt, messageopt, fileName, lineNumber)

Constructs a new Error of the provided type. caplin.core.Error extends the built in Error and allows the error type to be specified in the constructor. The name property is set to the specified type.
Parameters:
Name Type Attributes Default Description
type String <optional>
'' The error type to be thrown.
message String <optional>
'' A human-readable description of the error.
fileName String The name of the file containing the code that caused the error.
lineNumber int The line number of the code that caused the error.
Deprecated:
  • This functionality is now provided by BladeRunnerJS, and this class will be removed from CaplinTrader in a future release. Please use module:br/Errors instead.

    Members

    (static) ILLEGAL_STATE

    This error type is thrown when a method has been invoked at an illegal or inappropriate time.

    (static) INVALID_PARAMETERS

    This error type is thrown when a method is called with one or more invalid parameters. This could either be because a required parameter is not provided or a provided parameter is of the wrong type or is invalid for another reason (eg a string representation of a date that doesn't parse to an actual date).

    (static) INVALID_TEST

    This error type is thrown from acceptance test fixtures and indicates a problem with the test rather than the code under test. For example, if a particular fixture can only be used in a 'given' clause but is invoked in a 'then' clause, this error will be thrown. This will result in a test 'error' rather than a test 'failure'.

    (static) LEGACY

    This type should not be used for new code. caplin.core.Error replaces caplin.core.Exception and any where that switch has been made the LegacyError type has been used. Over time these instances will be replaced with more meaningful types for each particular case and this type will eventually be removed.
    Deprecated:
    • Yes

    (static) NOT_SUPPORTED

    This error is thrown when an operation is being attempted on a class instance and it does not have the required implementation.

    (static) UNIMPLEMENTED_ABSTRACT_METHOD

    This error is thrown when an abstract method is called that should have been implemented in the extending class.

    (static) UNIMPLEMENTED_INTERFACE

    This error is thrown when an interface method is called that should have been implemented in the interface implementor class.