@@ -35,7 +35,6 @@ import (
35
35
"github.com/fatih/color"
36
36
"github.com/sirupsen/logrus"
37
37
38
- "github.com/arduino/arduino-cli/cli/errorcodes"
39
38
"github.com/arduino/arduino-cli/cli/instance"
40
39
"github.com/arduino/arduino-cli/commands/compile"
41
40
"github.com/arduino/arduino-cli/commands/upload"
@@ -147,14 +146,14 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
147
146
logrus .Info ("Executing `arduino-cli compile`" )
148
147
149
148
if dumpProfile && feedback .GetFormat () != feedback .Text {
150
- feedback .Fatal (tr ("You cannot use the %[1]s flag together with %[2]s." , "--dump-profile" , "--format json" ), errorcodes .ErrBadArgument )
149
+ feedback .Fatal (tr ("You cannot use the %[1]s flag together with %[2]s." , "--dump-profile" , "--format json" ), feedback .ErrBadArgument )
151
150
}
152
151
if profileArg .Get () != "" {
153
152
if len (libraries ) > 0 {
154
- feedback .Fatal (tr ("You cannot use the %s flag while compiling with a profile." , "--libraries" ), errorcodes .ErrBadArgument )
153
+ feedback .Fatal (tr ("You cannot use the %s flag while compiling with a profile." , "--libraries" ), feedback .ErrBadArgument )
155
154
}
156
155
if len (library ) > 0 {
157
- feedback .Fatal (tr ("You cannot use the %s flag while compiling with a profile." , "--library" ), errorcodes .ErrBadArgument )
156
+ feedback .Fatal (tr ("You cannot use the %s flag while compiling with a profile." , "--library" ), feedback .ErrBadArgument )
158
157
}
159
158
}
160
159
@@ -181,13 +180,13 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
181
180
if sourceOverrides != "" {
182
181
data , err := paths .New (sourceOverrides ).ReadFile ()
183
182
if err != nil {
184
- feedback .Fatal (tr ("Error opening source code overrides data file: %v" , err ), errorcodes .ErrGeneric )
183
+ feedback .Fatal (tr ("Error opening source code overrides data file: %v" , err ), feedback .ErrGeneric )
185
184
}
186
185
var o struct {
187
186
Overrides map [string ]string `json:"overrides"`
188
187
}
189
188
if err := json .Unmarshal (data , & o ); err != nil {
190
- feedback .Fatal (tr ("Error: invalid source code overrides data file: %v" , err ), errorcodes .ErrGeneric )
189
+ feedback .Fatal (tr ("Error: invalid source code overrides data file: %v" , err ), feedback .ErrGeneric )
191
190
}
192
191
overrides = o .Overrides
193
192
}
@@ -228,14 +227,14 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
228
227
Protocol : port .Protocol ,
229
228
})
230
229
if err != nil {
231
- feedback .Fatal (tr ("Error during Upload: %v" , err ), errorcodes .ErrGeneric )
230
+ feedback .Fatal (tr ("Error during Upload: %v" , err ), feedback .ErrGeneric )
232
231
}
233
232
234
233
fields := map [string ]string {}
235
234
if len (userFieldRes .UserFields ) > 0 {
236
235
feedback .Print (tr ("Uploading to specified board using %s protocol requires the following info:" , port .Protocol ))
237
236
if f , err := arguments .AskForUserFields (userFieldRes .UserFields ); err != nil {
238
- feedback .FatalError (err , errorcodes .ErrBadArgument )
237
+ feedback .FatalError (err , feedback .ErrBadArgument )
239
238
} else {
240
239
fields = f
241
240
}
@@ -254,7 +253,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
254
253
}
255
254
256
255
if err := upload .Upload (context .Background (), uploadRequest , stdOut , stdErr ); err != nil {
257
- feedback .Fatal (tr ("Error during Upload: %v" , err ), errorcodes .ErrGeneric )
256
+ feedback .Fatal (tr ("Error during Upload: %v" , err ), feedback .ErrGeneric )
258
257
}
259
258
}
260
259
@@ -308,7 +307,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
308
307
309
308
// Output profile as a result
310
309
if _ , err := stdOut .Write ([]byte (profile )); err != nil {
311
- feedback .FatalError (err , errorcodes .ErrGeneric )
310
+ feedback .FatalError (err , feedback .ErrGeneric )
312
311
}
313
312
feedback .PrintResult (stdIORes ())
314
313
os .Exit (0 )
@@ -351,7 +350,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
351
350
}
352
351
}
353
352
}
354
- feedback .Fatal (msg , errorcodes .ErrGeneric )
353
+ feedback .Fatal (msg , feedback .ErrGeneric )
355
354
}
356
355
}
357
356
0 commit comments