File tree 2 files changed +10
-10
lines changed
arduino-ide-extension/src/common/protocol
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -73,12 +73,12 @@ export namespace CoreError {
73
73
UploadUsingProgrammer : 4003 ,
74
74
BurnBootloader : 4004 ,
75
75
} ;
76
- export const VerifyFailed = create ( Codes . Verify ) ;
77
- export const UploadFailed = create ( Codes . Upload ) ;
78
- export const UploadUsingProgrammerFailed = create (
76
+ export const VerifyFailed = declareCoreError ( Codes . Verify ) ;
77
+ export const UploadFailed = declareCoreError ( Codes . Upload ) ;
78
+ export const UploadUsingProgrammerFailed = declareCoreError (
79
79
Codes . UploadUsingProgrammer
80
80
) ;
81
- export const BurnBootloaderFailed = create ( Codes . BurnBootloader ) ;
81
+ export const BurnBootloaderFailed = declareCoreError ( Codes . BurnBootloader ) ;
82
82
export function is (
83
83
error : unknown
84
84
) : error is ApplicationError < number , ErrorLocation [ ] > {
@@ -88,7 +88,7 @@ export namespace CoreError {
88
88
Object . values ( Codes ) . includes ( error . code )
89
89
) ;
90
90
}
91
- function create (
91
+ function declareCoreError (
92
92
code : number
93
93
) : ApplicationError . Constructor < number , ErrorLocation [ ] > {
94
94
return ApplicationError . declare (
Original file line number Diff line number Diff line change @@ -79,16 +79,16 @@ export const MonitorErrorCodes = {
79
79
MissingConfiguration : 6004 ,
80
80
} as const ;
81
81
82
- export const ConnectionFailedError = createMonitorError (
82
+ export const ConnectionFailedError = declareMonitorError (
83
83
MonitorErrorCodes . ConnectionFailed
84
84
) ;
85
- export const NotConnectedError = createMonitorError (
85
+ export const NotConnectedError = declareMonitorError (
86
86
MonitorErrorCodes . NotConnected
87
87
) ;
88
- export const AlreadyConnectedError = createMonitorError (
88
+ export const AlreadyConnectedError = declareMonitorError (
89
89
MonitorErrorCodes . AlreadyConnected
90
90
) ;
91
- export const MissingConfigurationError = createMonitorError (
91
+ export const MissingConfigurationError = declareMonitorError (
92
92
MonitorErrorCodes . MissingConfiguration
93
93
) ;
94
94
@@ -167,7 +167,7 @@ interface PortDescriptor {
167
167
readonly protocol : string ;
168
168
readonly address : string ;
169
169
}
170
- function createMonitorError (
170
+ function declareMonitorError (
171
171
code : number
172
172
) : ApplicationError . Constructor < number , PortDescriptor > {
173
173
return ApplicationError . declare (
You can’t perform that action at this time.
0 commit comments