Skip to content

Exception Handling Overview

When submitting a technical drawing to WERK24 for automated analysis, things can occasionally go wrong. Proper error handling is crucial to ensure that you can quickly inform your customer and take corrective action to resolve the issue.

Basic Concept

WERK24's Python Client communicates with the TechRead API using a websocket connection. This allows you to submit a technical drawing once and simultaneously pose a range of Asks, which are answered as information becomes available. This enables fully asynchronous communication—for example, you can display a thumbnail to your customer while waiting for measurements to be extracted.

However, this requires more bookkeeping to manage exceptions. Each Ask response contains a field called exceptions, which includes a list of W24TechreadException objects that describe what went wrong.

Exception Levels

WERK24 provides four levels of exceptions to indicate the severity of an issue:

Level Meaning
ERROR The request could not be processed correctly. In this case, the payload_dict or payload_bytes will be empty.
WARNING The request was processed correctly, but there is something you should be aware of (e.g., deprecated features).
INFO The request was processed correctly, but there is additional information (e.g., a new client version is available).
DEBUG Available to development partners during the development of joint features.

Exception Types

The exception types tell you exactly what went wrong, allowing you to take specific actions based on your use case.

Exception Type Description
DRAWING_FILE_FORMAT_UNSUPPORTED The file format is not supported. See Limitations/DrawingFileFormat.
DRAWING_FILE_SIZE_TOO_LARGE The file size exceeds the limit. See Limitations/DrawingFileSize.
DRAWING_RESOLUTION_TOO_LOW The image resolution is too low. See Limitations/DrawingResolution.

By understanding the type and severity of exceptions, you can respond appropriately and improve your error-handling strategy, ensuring a smoother experience for your customers.