tc-context
Version:
TwinCAT ADS Communication Library for creating an active TwinCAT Context, with automatic symbol and type mapping
298 lines • 12.3 kB
TypeScript
/**
* Module containing all the exceptions, that can be thrown by the `tc-context` library
*
*
* Licensed under MIT License.
*
* Copyright (c) 2020 Dmitrij Trifanov <d.v.trifanov@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* @packageDocumentation
*/
import { TcContext } from './tc-context';
import { TcBinding } from './tc-binding';
import { TcCom } from './tc-com';
/**
* Main Exception Class of the `tc-context` library. Every exception thrown from the `tc-context` library
* derives from this Class.
*
* Event `TcException` stores the `TcContext` from which it originated.
*/
export declare class TcException extends Error {
/**
* Construct a `TcException` with the `TcContext`, from which it originated, and the
* error message
*
* @param context - The `TcContext` from which the exception originated
* @param message - Error message
*/
constructor(context: TcContext, message: string);
/**
* Construct a `TcException` with the `TcContext`, from which it originated, and the
* error message, as well as any parent Error that can provide additional information
*
* @param context - The `TcContext` from which the exception originated
* @param message - Error message
* @param parent - The parent Error of this `TcException`
*/
constructor(context: TcContext, message: string, parent: Error);
/**
* Construct a `TcException` with the `TcContext`, from which it originated, and the
* error message, as well as additional data associated with this error
*
* @param context - The `TcContext` from which the exception originated
* @param message - Error message
* @param data - The Data, which is associated with this `TcException`
*/
constructor(context: TcContext, message: string, data: any);
/**
* Construct a `TcException` with the `TcContext`, from which it originated, and the
* error message, as well as both the parent Error and additional Error Data
*
* @param context - The `TcContext` from which the exception originated
* @param message - Error message
* @param parent - The parent Error of this `TcException`
* @param data - The Data, which is associated with this `TcException`
*/
constructor(context: TcContext, message: string, parent: Error, data: any);
/**
* Access the `TcContext`, from which this `TcException` originated
*/
get context(): TcContext;
/**
* Access any data, associated with this `TcException`
*/
get data(): any | undefined;
/**
* Access any parent error, that was raised alongside this `TcException`
*/
get parent(): Error | undefined;
/**
* Stores the `TcContext`
* @internal
*/
private __context;
/**
* Stores additional Error Data
* @internal
*/
private __data;
/**
* Stores potential parent error
* @internal
*/
private __parent?;
}
/**
* Exception Class, for every Error produced by the `TcBinding` Object through the `TcSymbol` Object
*
* Will also store the `TcBinding`, that threw the exception originally
*/
export declare class TcBindingException extends TcException {
/**
* Construct a `TcBindingException` with the `TcContext`, from which it originated, the `TcBinding`, which raised it and the
* error message
*
* @param context - The `TcContext` from which the exception originated
* @param sender - The `TcBinding` from which the exception originated
* @param message - Error message
*/
constructor(context: TcContext, sender: TcBinding, message: string);
/**
* Construct a `TcException` with the `TcBinding`, from which it originated, and the
* error message, as well as any parent Error that can provide additional information
*
* @param context - The `TcContext` from which the exception originated
* @param sender - The `TcBinding` from which the exception originated
* @param message - Error message
* @param parent - The parent Error of this `TcException`
*/
constructor(context: TcContext, sender: TcBinding, message: string, parent: Error);
/**
* Construct a `TcException` with the `TcBinding`, from which it originated, and the
* error message, as well as additional data associated with this error
*
* @param context - The `TcContext` from which the exception originated
* @param sender - The `TcBinding` from which the exception originated
* @param message - Error message
* @param data - The Data, which is associated with this `TcException`
*/
constructor(context: TcContext, sender: TcBinding, message: string, data: any);
/**
* Construct a `TcException` with the `TcBinding`, from which it originated, and the
* error message, as well as both the parent Error and additional Error Data
*
* @param context - The `TcContext` from which the exception originated
* @param sender - The `TcBinding` from which the exception originated
* @param message - Error message
* @param parent - The parent Error of this `TcException`
* @param data - The Data, which is associated with this `TcException`
*/
constructor(context: TcContext, sender: TcBinding, message: string, parent: Error, data: any);
/**
* Access the `TcBinding`, from which this `TcException` originated
*/
get sender(): TcBinding;
/**
* Stores the exception sender
* @internal
*/
private __sender;
}
/**
* Exception raised when an operation was called on an invalidated `TcBinding`
*/
export declare class TcBindingIsInvalidException extends TcBindingException {
}
/**
* Exception raised when an invalid type was passed to the `TcBinding`
*/
export declare class TcBindingInvalidTypeException extends TcBindingException {
}
/**
* Exception raised when a value that is out of allowed range was passed to the `TcBinding`
*/
export declare class TcBindingOutOfRangeException extends TcBindingException {
}
/**
* Exception raised when a write operation was called on a ReadOnly `TcBinding`
*/
export declare class TcBindingReadOnlyException extends TcBindingException {
}
/**
* Exception Class, for every Error produced by the `TcCom` Object
*
* Will also store the `TcCom`, that threw the exception originally
*/
export declare class TcComException extends TcException {
/**
* Construct a `TcBindingException` with the `TcContext`, from which it originated, the `TcCom`, which raised it and the
* error message
*
* @param context - The `TcContext` from which the exception originated
* @param sender - The `TcCom` from which the exception originated
* @param message - Error message
*/
constructor(context: TcContext, sender: TcCom, message: string);
/**
* Construct a `TcException` with the `TcCom`, from which it originated, and the
* error message, as well as any parent Error that can provide additional information
*
* @param context - The `TcContext` from which the exception originated
* @param sender - The `TcCom` from which the exception originated
* @param message - Error message
* @param parent - The parent Error of this `TcException`
*/
constructor(context: TcContext, sender: TcCom, message: string, parent: Error);
/**
* Construct a `TcException` with the `TcCom`, from which it originated, and the
* error message, as well as additional data associated with this error
*
* @param context - The `TcContext` from which the exception originated
* @param sender - The `TcCom` from which the exception originated
* @param message - Error message
* @param data - The Data, which is associated with this `TcException`
*/
constructor(context: TcContext, sender: TcCom, message: string, data: any);
/**
* Construct a `TcException` with the `TcCom`, from which it originated, and the
* error message, as well as both the parent Error and additional Error Data
*
* @param context - The `TcContext` from which the exception originated
* @param sender - The `TcCom` from which the exception originated
* @param message - Error message
* @param parent - The parent Error of this `TcException`
* @param data - The Data, which is associated with this `TcException`
*/
constructor(context: TcContext, sender: TcCom, message: string, parent: Error, data: any);
/**
* Access the `TcCom`, from which this `TcException` originated
*/
get sender(): TcCom;
/**
* Stores the exception sender
* @internal
*/
private __sender;
}
/**
* Exception raised when an operation was called on an uninitialized `TcCom`
*/
export declare class TcComBusyException extends TcComException {
}
/**
* Exception raised when an operation was called on an invalidated `TcCom`
*/
export declare class TcComIsInvalidException extends TcComException {
}
/**
* Exception raised when an error happens during ADS Connection
*/
export declare class TcComConnectException extends TcComException {
}
/**
* Exception raised when an error happens during ADS Disconnect
*/
export declare class TcComDisconnectException extends TcComException {
}
/**
* Exception raised when an error happens during an attempt to monitor Code Changes
*/
export declare class TcComChangeDetectionException extends TcComException {
}
/**
* Exception raised when an error happens during unsubscribing from a Target PLC Symbol
*/
export declare class TcComUnsubscribeException extends TcComException {
}
/**
* Exception raised when an error happens during conversion of values to Raw Data
*/
export declare class TcComFromRawException extends TcComException {
}
/**
* Exception raised when an error happens during conversion of Raw Data to values
*/
export declare class TcComToRawException extends TcComException {
}
/**
* Exception raised when an error happens during subscription to a Target PLC Symbol
*/
export declare class TcComSubscribeException extends TcComException {
}
/**
* Exception raised when an error happens during ADS Write operation
*/
export declare class TcComDataWriteException extends TcComException {
}
/**
* Exception raised when an error happens during ADS Read operation
*/
export declare class TcComDataReadException extends TcComException {
}
/**
* Exception raised when an error happens during the fetch of ADS Type Data
*/
export declare class TcComTypeQueryException extends TcComException {
}
/**
* Exception raised when an error happens during the fetch of ADS Symbol Data
*/
export declare class TcComSymbolQueryException extends TcComException {
}
/**
* Exception raised when an error happens during a call to a Method of a Function Block
*/
export declare class TcComMethodCallException extends TcComException {
}
//# sourceMappingURL=tc-exception.d.ts.map