Skip to content

Improve error message on build failure #536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 7, 2020
Merged

Improve error message on build failure #536

merged 3 commits into from
Jan 7, 2020

Conversation

masci
Copy link
Contributor

@masci masci commented Jan 2, 2020

Fixes #527

At some point, deep into the legacy package, some function returns an error with an empty message, causing the command to fail in suspense with "Error during build: build failed: .

This is a workaround, the real fix would be going on a quest in search of the command(s) returning the empty error.

@federicobond
Copy link
Contributor

Change LGTM. The errors with missing messages can be found here:

if textSize > maxTextSize {
logger.Println(constants.LOG_LEVEL_ERROR, constants.MSG_SIZER_TEXT_TOO_BIG)
return errors.New("")
}
if maxDataSize > 0 && dataSize > maxDataSize {
logger.Println(constants.LOG_LEVEL_ERROR, constants.MSG_SIZER_DATA_TOO_BIG)
return errors.New("")
}

If you want, I can submit a pull request adding proper messages along the lines of "text/data section exceeds available space in board" .

@masci
Copy link
Contributor Author

masci commented Jan 2, 2020

@federicobond thanks a ton for pointing me to the error, it was faster for me to just fix it in this PR but I've used your suggestion regarding the message. I've also removed the workaround if err.Error() == "".

@masci masci merged commit 85a0273 into master Jan 7, 2020
@masci masci deleted the massi/527 branch January 7, 2020 16:57
@masci masci added this to the 0.7.2 milestone Jan 8, 2020
masci pushed a commit that referenced this pull request Jan 8, 2020
* Improve error message on build failure
* properly report an error message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incomplete error message when sketch uses too much memory
3 participants