This commit is contained in:
Developer
2026-05-18 17:52:09 +08:00
commit cae04eead5
62 changed files with 11230 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
/// Custom exception for printer operations.
///
/// Encapsulates structured error information from the native layer,
/// including error code, message, and optional details.
class PrinterException implements Exception {
/// Machine-readable error code (e.g., 'INVALID_ARGUMENT', 'PORT_OPEN_FAILED').
final String code;
/// Human-readable error message.
final String message;
/// Additional error details (may be null).
final dynamic details;
/// Creates a [PrinterException] with the given [code] and [message].
const PrinterException({
required this.code,
required this.message,
this.details,
});
@override
String toString() => 'PrinterException($code): $message';
}