Class WinccoaError

Error class that contains additional information found in WinCC OA errors, like the WinCC OA error code.

import { WinccoaManager, WinccoaError } from 'winccoa-manager';
const winccoa = new WinccoaManager();

try {
...
} catch(exc) {
// standard reporting
console.error(exc);

// access the details
var oaError = exc as WinccoaError;
console.warn('Error code : ' + oaError.code);
console.warn('Error message : ' + oaError.message);
console.warn('Catalogue : ' + oaError.catalog);
console.warn('Details : ' + oaError.details);
}
const { WinccoaManager } = require('winccoa-manager');
const winccoa = new WinccoaManager();

try {
...
} catch(exc) {
// standard reporting
console.error(exc);

// access the details
console.warn('Error code : ' + exc.code);
console.warn('Error message : ' + exc.message);
console.warn('Catalogue : ' + exc.catalog);
console.warn('Details : ' + exc.details);
}

Hierarchy

  • Error
    • WinccoaError

Constructors

Properties

Constructors

  • Constructor. This constructor is also used by the WinccoaManager to create WinccoaError instances.

    Parameters

    • code: string | number

      WincCC OA error code. This can either be a number (like 71 for "DP does not exist") or a string. The meaning of string error codes can be found in the corresponding catalog.

    • message: string

      Error message corresponding to code.

    • catalog: string = ''

      Name of the error catalog where the error message can be found. If empty, this refers to catalog _errors.cat.

    • Optionaldetails: unknown

      Additional details specific to that error. Not all errors provide this information.

    Returns WinccoaError

Properties

catalog: string = ''

Name of the error catalog where the error message can be found. If empty, this refers to catalog _errors.cat.

code: string | number

WincCC OA error code. This can either be a number (like 71 for "DP does not exist") or a string. The meaning of string error codes can be found in the corresponding catalog.

details?: unknown

Additional details specific to that error. Not all errors provide this information.