Skip to content

Commit bdce7e9

Browse files
Massimiliano Pippimasci
Massimiliano Pippi
authored andcommitted
Improve error message on build failure (#536)
* Improve error message on build failure * properly report an error message
1 parent 7668c46 commit bdce7e9

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
@@ -163,7 +163,7 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
163163

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

169169
// 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
@@ -105,12 +105,12 @@ func checkSize(ctx *types.Context, buildProperties *properties.Map) error {
105105

106106
if textSize > maxTextSize {
107107
logger.Println(constants.LOG_LEVEL_ERROR, constants.MSG_SIZER_TEXT_TOO_BIG)
108-
return errors.New("")
108+
return errors.New("text section exceeds available space in board")
109109
}
110110

111111
if maxDataSize > 0 && dataSize > maxDataSize {
112112
logger.Println(constants.LOG_LEVEL_ERROR, constants.MSG_SIZER_DATA_TOO_BIG)
113-
return errors.New("")
113+
return errors.New("data section exceeds available space in board")
114114
}
115115

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

0 commit comments

Comments
 (0)