Method decorator that prevents a structure from overflowing. The structure
must implement CappedStructure interface. In case of overflow, it throws
an error if throwError parameter is set to true, or returns the
specified returnValue otherwise.
Parameters
throwError: boolean
Whether it should throw an error or not in case of overflow
Optional returnValue: any
The value to be returned in case of overflow, if throwError
is set to false (it is ignored otherwise)
Method decorator that prevents a structure from overflowing. The structure must implement CappedStructure interface. In case of overflow, it throws an error if
throwError
parameter is set totrue
, or returns the specifiedreturnValue
otherwise.