Files
sim/apps/sim/lib/tokenization/errors.ts
Vikhyath Mondreti 0bf9ce0b9e feat(enhanced logs): integration + log visualizer canvas (#618)
* feat(logs): enhanced logging system with cleanup and theme fixes

- Implement enhanced logging cleanup with S3 archival and retention policies
- Fix error propagation in trace spans for manual executions
- Add theme-aware styling for frozen canvas modal
- Integrate enhanced logging system across all execution pathways
- Add comprehensive trace span processing and iteration navigation
- Fix boolean parameter types in enhanced logs API

* add warning for old logs

* fix lint

* added cost for streaming outputs

* fix overflow issue

* fix lint

* fix selection on closing sidebar

* tooltips z index increase

---------

Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@vikhyaths-air.lan>
Co-authored-by: Waleed Latif <walif6@gmail.com>
2025-07-06 20:01:28 -07:00

24 lines
687 B
TypeScript

/**
* Custom error classes for tokenization functionality
*/
export class TokenizationError extends Error {
public readonly code: 'INVALID_PROVIDER' | 'MISSING_TEXT' | 'CALCULATION_FAILED' | 'INVALID_MODEL'
public readonly details?: Record<string, unknown>
constructor(message: string, code: TokenizationError['code'], details?: Record<string, unknown>) {
super(message)
this.name = 'TokenizationError'
this.code = code
this.details = details
}
}
export function createTokenizationError(
code: TokenizationError['code'],
message: string,
details?: Record<string, unknown>
): TokenizationError {
return new TokenizationError(message, code, details)
}