-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.d.ts
More file actions
92 lines (81 loc) · 1.89 KB
/
Copy patherrors.d.ts
File metadata and controls
92 lines (81 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/**
* @fileoverview TypeScript definitions for custom error classes
* @module errors
*/
/**
* Base error class for CD48-related errors
*/
export class CD48Error extends Error {
name: string;
constructor(message: string);
}
/**
* Error thrown when Web Serial API is not supported
*/
export class UnsupportedBrowserError extends CD48Error {
constructor();
}
/**
* Error thrown when device is not connected
*/
export class NotConnectedError extends CD48Error {
operation: string;
constructor(operation: string);
}
/**
* Error thrown when connection fails
*/
export class ConnectionError extends CD48Error {
cause?: any;
constructor(message: string, cause?: any);
}
/**
* Error thrown when user cancels device selection
*/
export class DeviceSelectionCancelledError extends CD48Error {
constructor();
}
/**
* Error thrown when command times out
*/
export class CommandTimeoutError extends CD48Error {
command: string;
timeout: number;
constructor(command: string, timeout: number);
}
/**
* Error thrown when response format is invalid
*/
export class InvalidResponseError extends CD48Error {
response: string;
expected: string;
constructor(response: string, expected: string);
}
/**
* Error thrown when parameter validation fails
*/
export class ValidationError extends CD48Error {
parameter: string;
value: any;
constraints: string;
constructor(parameter: string, value: any, constraints: string);
}
/**
* Error thrown when channel number is out of range
*/
export class InvalidChannelError extends ValidationError {
constructor(channel: number);
}
/**
* Error thrown when voltage is out of range
*/
export class InvalidVoltageError extends ValidationError {
constructor(voltage: number);
}
/**
* Error thrown when communication with device fails
*/
export class CommunicationError extends CD48Error {
cause?: any;
constructor(message: string, cause?: any);
}