Skip to content

incendium.exceptions

César Román edited this page Sep 22, 2026 · 8 revisions

Description

Custom exception classes for the incendium package.

This module defines the Error base class and the JavaError subclass used to wrap Java exceptions, along with the specialized ApplicationError, GatewayError, MSSQLError, and TagError classes, and the get_function_name helper used to build error messages.

Base Classes

Classes

Functions

Recommendations

[PEP8] recommends the following:

When catching exceptions, mention specific exceptions whenever possible instead of using a bare except: clause.

For example, use:

try:
    import platform_specific_module
except ImportError:
    platform_specific_module = None

A bare except: clause will catch SystemExit and KeyboardInterrupt exceptions, making it harder to interrupt a program with Control-C, and can disguise other problems. If you want to catch all exceptions that signal program errors, use except Exception: (bare except is equivalent to except BaseException:).

A good rule of thumb is to limit use of bare 'except' clauses to two cases:

  1. If the exception handler will be printing out or logging the traceback; at least the user will be aware that an error has occurred.
  2. If the code needs to do some cleanup work, but then lets the exception propagate upwards with raise. try...finally can be a better way to handle this case.

Wiki

Core

Communication

Database & Data

Tag

Time & Date

UI

Vision

ZPL

Clone this wiki locally