winccoa-manager
    Preparing search index...

    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
    Index

    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.

      • Optionalcatalog: 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.

      • Optionalpriority: number

        Optional priority.

      • OptionalerrorType: number

        Optional errorType.

      • Optionaldpe: string

        Optional data point.

      • OptionaluserId: number

        Optional userId.

      • OptionalerrorTime: WinccoaTime

        Optional time when error occured in milliseconds since 1.1.1970.

      Returns WinccoaError

    • Constructor. This constructor is also used by the WinccoaManager to create WinccoaError instances. The code member will be set to MULTIPLE_ERRORS_CODE and Error.message contains at most 10 errors ordered by importance. An error is important if the priority is <= WinccoaErrorPriority.Severe (see WinccoaErrorPriority).

      Parameters

      • code: WinccoaError[]

        Array of WincCC OA errors which are in the details member.

      Returns WinccoaError

    Properties

    catalog: string = ''
    code: string | number | WinccoaError[]
    details?: unknown
    dpe?: string
    errorTime?: WinccoaTime
    errorType?: WinccoaErrorType
    userId?: number
    MULTIPLE_ERRORS_CODE: 10000

    Code for multiple errors in details. details is in that case an array of WinccoaError instances.

    Accessors

    • get multipleErrors(): boolean

      Returns boolean

      true if details contains multiple (at least 2) WinccoaError instances.

    Methods

    • Returns string

      code and message from all errors