Skip to content

Commit 85a0273

Browse files
author
Massimiliano Pippi
authored
Improve error message on build failure (arduino#536)
* Improve error message on build failure * properly report an error message
1 parent 5f4a92e commit 85a0273

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cli/compile/compile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func NewCommand() *cobra.Command {
8686
func run(cmd *cobra.Command, args []string) {
8787
inst, err := instance.CreateInstance()
8888
if err != nil {
89-
feedback.Errorf("Error during build: %v", err)
89+
feedback.Errorf("Error creating instance: %v", err)
9090
os.Exit(errorcodes.ErrGeneric)
9191
}
9292

commands/compile/compile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
161161

162162
// if it's a regular build, go on...
163163
if err := builder.RunBuilder(builderCtx); err != nil {
164-
return nil, fmt.Errorf("build failed: %s", err)
164+
return nil, err
165165
}
166166

167167
// FIXME: Make a function to obtain these info...

legacy/builder/phases/sizer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ func checkSize(ctx *types.Context, buildProperties *properties.Map) error {
9191

9292
if textSize > maxTextSize {
9393
logger.Println(constants.LOG_LEVEL_ERROR, constants.MSG_SIZER_TEXT_TOO_BIG)
94-
return errors.New("")
94+
return errors.New("text section exceeds available space in board")
9595
}
9696

9797
if maxDataSize > 0 && dataSize > maxDataSize {
9898
logger.Println(constants.LOG_LEVEL_ERROR, constants.MSG_SIZER_DATA_TOO_BIG)
99-
return errors.New("")
99+
return errors.New("data section exceeds available space in board")
100100
}
101101

102102
if properties.Get(constants.PROPERTY_WARN_DATA_PERCENT) != "" {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy