Skip to content

Commit 8930dc9

Browse files
committed
fix: implement secure error handling system and improve README badges
1 parent fa8b9b7 commit 8930dc9

File tree

2 files changed

+26
-13
lines changed

2 files changed

+26
-13
lines changed

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
77
[![CI](https://github.com/typelets/typelets-app/actions/workflows/release.yml/badge.svg)](https://github.com/typelets/typelets-app/actions)
88
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
9-
[![Code Quality](https://img.shields.io/codefactor/grade/github/typelets/typelets-app?style=for-the-badge)](https://www.codefactor.io/repository/github/typelets/typelets-app)
10-
[![Commit Activity](https://img.shields.io/github/commit-activity/m/typelets/typelets-app?style=for-the-badge)](https://github.com/typelets/typelets-app/commits/main)
11-
129
[![React](https://img.shields.io/badge/React-19-blue?logo=react)](https://react.dev/)
1310
[![TypeScript](https://img.shields.io/badge/TypeScript-5.8-blue?logo=typescript)](https://www.typescriptlang.org/)
1411
[![Vite](https://img.shields.io/badge/Vite-7-646CFF?logo=vite)](https://vitejs.dev/)
@@ -29,18 +26,16 @@
2926

3027
## 📥 Download Desktop App
3128

32-
[![Windows](https://img.shields.io/badge/Windows-Download-0078d4?style=for-the-badge&logo=windows)](
33-
https://github.com/typelets/typelets-app/releases/latest)
34-
[![Mac](https://img.shields.io/badge/Mac-Coming%20Soon-lightgrey?style=for-the-badge&logo=apple)](https://github.com/typelets/typelets-app/releases)
35-
[![Linux](https://img.shields.io/badge/Linux-Coming%20Soon-lightgrey?style=for-the-badge&logo=linux)](https://github.com/typelets/typelets-app/releases)
29+
[![Windows](https://img.shields.io/badge/Windows-Download-0078D4?style=for-the-badge)](https://github.com/typelets/typelets-app/releases/latest)
30+
[![Mac](https://img.shields.io/badge/Mac-Download-000000?style=for-the-badge)](https://github.com/typelets/typelets-app/releases)
31+
[![Linux](https://img.shields.io/badge/Linux-Download-E95420?style=for-the-badge)](https://github.com/typelets/typelets-app/releases)
3632

37-
**Latest Release:** [![GitHub release](https://img.shields.io/github/v/release/typelets/typelets-app)](https://github.com/typelets/typelets-app/releases/latest)
33+
[![GitHub release](https://img.shields.io/github/v/release/typelets/typelets-app)](https://github.com/typelets/typelets-app/releases/latest)
3834

3935
Get the native desktop experience with:
4036
- 🖥️ **Native desktop integration** - System tray, notifications, and OS-specific features
4137
-**Better performance** - No browser overhead for faster note editing
4238
- 🔒 **Enhanced security** - Isolated environment with no browser extensions interference
43-
- 💾 **Offline-first** - Access your notes even without internet connection
4439

4540
## ✨ Features
4641

src/lib/errors/SecureError.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
export type ErrorSeverity = 'low' | 'medium' | 'high' | 'critical';
66

7+
// Error codes:
8+
// AUTH_001-003: Authentication errors
9+
// CRYPTO_001-003: Encryption errors
10+
// NETWORK_001-003: Network errors
11+
// STORAGE_001-003: Storage errors
12+
// WS_001-003: WebSocket errors
13+
// FILE_001-003: File operation errors
14+
// VALIDATION_001-002: Validation errors
15+
// UNKNOWN_ERROR: Fallback
716
export type ErrorCode =
817
| 'AUTH_001' | 'AUTH_002' | 'AUTH_003'
918
| 'CRYPTO_001' | 'CRYPTO_002' | 'CRYPTO_003'
@@ -15,15 +24,24 @@ export type ErrorCode =
1524
| 'UNKNOWN_ERROR';
1625

1726
export class SecureError extends Error {
27+
public readonly userMessage: string;
28+
public readonly code: ErrorCode;
29+
public readonly severity: ErrorSeverity;
30+
public readonly originalError?: unknown;
31+
1832
constructor(
1933
message: string,
20-
public readonly userMessage: string,
21-
public readonly code: ErrorCode,
22-
public readonly severity: ErrorSeverity = 'medium',
23-
public readonly originalError?: unknown
34+
userMessage: string,
35+
code: ErrorCode,
36+
severity: ErrorSeverity = 'medium',
37+
originalError?: unknown
2438
) {
2539
super(message);
2640
this.name = 'SecureError';
41+
this.userMessage = userMessage;
42+
this.code = code;
43+
this.severity = severity;
44+
this.originalError = originalError;
2745
}
2846

2947
/**

0 commit comments

Comments
 (0)