Skip to content

Commit 85a0273

Browse files
author
Massimiliano Pippi
authored
Improve error message on build failure (#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

Diff for: cli/compile/compile.go

+1-1
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

Diff for: commands/compile/compile.go

+1-1
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...

Diff for: legacy/builder/phases/sizer.go

+2-2
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)