Unverified Commit bdce7e90 authored by Massimiliano Pippi's avatar Massimiliano Pippi Committed by Massimiliano Pippi

Improve error message on build failure (#536)

* Improve error message on build failure
* properly report an error message
parent 7668c465
......@@ -86,7 +86,7 @@ func NewCommand() *cobra.Command {
func run(cmd *cobra.Command, args []string) {
inst, err := instance.CreateInstance()
if err != nil {
feedback.Errorf("Error during build: %v", err)
feedback.Errorf("Error creating instance: %v", err)
os.Exit(errorcodes.ErrGeneric)
}
......
......@@ -163,7 +163,7 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
// if it's a regular build, go on...
if err := builder.RunBuilder(builderCtx); err != nil {
return nil, fmt.Errorf("build failed: %s", err)
return nil, err
}
// FIXME: Make a function to obtain these info...
......
......@@ -105,12 +105,12 @@ func checkSize(ctx *types.Context, buildProperties *properties.Map) error {
if textSize > maxTextSize {
logger.Println(constants.LOG_LEVEL_ERROR, constants.MSG_SIZER_TEXT_TOO_BIG)
return errors.New("")
return errors.New("text section exceeds available space in board")
}
if maxDataSize > 0 && dataSize > maxDataSize {
logger.Println(constants.LOG_LEVEL_ERROR, constants.MSG_SIZER_DATA_TOO_BIG)
return errors.New("")
return errors.New("data section exceeds available space in board")
}
if properties.Get(constants.PROPERTY_WARN_DATA_PERCENT) != "" {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment