Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

BaSyx / Documentation / VAB / Exceptions

< BaSyx ‎ | Documentation ‎ | VAB
Revision as of 09:16, 30 July 2020 by Zai.mueller-zhang.iese.fraunhofer.de (Talk | contribs) (Created page with "== Exceptions == While accessing certain elements through the Virtual Automation Bus (VAB) using a model provider, exceptions would be generated in error cases. There are in...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Exceptions

While accessing certain elements through the Virtual Automation Bus (VAB) using a model provider, exceptions would be generated in error cases. There are in total four types of exceptions that could be generated in error cases while using the five primitives of the VAB to access the data. The message of the exception contains information of message type, text, and code.


The message type defines the type of the exception. The text describes the concrete reason why this exception is thrown. The code is inspired by HTTP codes that indicates the type of the exception. The example below illustrates the message structure in Json:


{
  "success": false,
    "messages": [
          {
        "messageType": "Information",
        "text": "Asset Administration Shell not found",
        "code": "404"
          }
    ]
}

The following table demonstrates the details and causes of these exceptions.

Exception Error Code Cause
MalformedRequestException 400 Exception is thrown if a request does not fit the current context. For example, if a registry receives an invalid descriptor or if an operation or a given VAB-path is invalid.
ResourceNotFoundException 404 Exception is thrown if the target element (or its parent element) does not exist.

For example, reading or updating a non-existing element, invoking a non-existing operation, or creating a new element under a non-existing parent element.

ResourceAlreadyExistsException 422 Exception is thrown if it is tried to create a resource which already exists.
ProviderException 500 For all other cases that are not covered by the above exceptions, a general provider exception is thrown.

Copyright © Eclipse Foundation, Inc. All Rights Reserved.