<<

NAME

Koha::Schema::Util::ExceptionTranslator - Centralized DBIx::Class exception translation

SYNOPSIS

    use Koha::Schema::Util::ExceptionTranslator;

    try {
        # DBIx::Class operation that might fail
        $schema->resultset('SomeTable')->create(\%data);
    } catch {
        Koha::Schema::Util::ExceptionTranslator->translate_exception($_, \%columns_info);
    };

DESCRIPTION

This utility class provides centralized exception translation from DBIx::Class exceptions to Koha-specific exceptions. This eliminates the need for duplicated exception handling code throughout the codebase.

METHODS

translate_exception

    Koha::Schema::Util::ExceptionTranslator->translate_exception($exception, $columns_info);

Translates a DBIx::Class exception into an appropriate Koha exception and throws it. If the exception cannot be translated, it rethrows the original exception.

Parameters

Exception Types Handled

FUTURE ENHANCEMENTS

This utility is designed to be extended to support:

AUTHOR

Koha Development Team

<<