tom_basics
The minimal-dependency base of the Tom stack: core utilities and a UUID-tracked base exception with stack-trace support that the whole framework builds on.
Overview
`tom_basics` is the utility floor at the bottom of every Tom application. It keeps its dependency surface as small as possible so that everything above — `tom_core_kernel`, the Flutter and server cores, and the build tools — can rest on it without inheriting weight. Its central type is `TomBaseException`, a base exception carrying a UUID, an error key, parameters, and stack-trace support, giving the framework a uniform, traceable error model. The other utilities here are the small, shared helpers the rest of Tom assumes are always present.
What it enables
Enables Tracked framework exceptions, tom_core_kernel foundation, Shared base utilities.
Relationships
Standalone — no declared relationships.
Tom Basics
Basic utilities for the TOM framework with minimal dependencies.
Features
- **TomBaseException** - Base exception class with UUID tracking and stack trace support
Getting Started
Add the package to your `pubspec.yaml`:
dependencies:
tom_basics: ^1.0.0
Usage
Exception Handling
import 'package:tom_basics/tom_basics.dart';
// Create and throw a tracked exception
throw TomBaseException(
'USER_NOT_FOUND',
'The requested user could not be found',
parameters: {'userId': userId},
);
// Catch and inspect
try {
// ... operation that may fail
} on TomBaseException catch (e) {
print('Error ${e.uuid}: ${e.key}');
print('Message: ${e.defaultUserMessage}');
e.printStackTrace();
}
Additional Information
This package provides foundational utilities that are used by other TOM framework packages, including:
- `tom_crypto` - Cryptographic utilities
- `tom_core_kernel` - Core kernel library
License
BSD-3-Clause - See [LICENSE](LICENSE) for details.
License
BSD 3-Clause License Copyright (c) 2024-2026, Peter Nicolai Alexis Kyaw Find me on LinkedIn under Alexis Kyaw All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.