-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Check return of BlockDevice::init() in TDBStore. #11595
Conversation
664969d
to
0ea5960
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Astyle shows one error , otherwise looks fine |
Return value was ignored, and TDBStore:init() ended up in a MBED_ERROR() phase after that. TDBStore API was limited to allow returning of only two separate errors, which may end up hiding the actual return value. Change the documentation slightly to allow returning of original error code from the underlying block device. Fixes ARMmbed#11591
0ea5960
to
513891d
Compare
Astyle should be fixed now. |
@SeppoTakalo, thank you for your changes. |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
In resolving a problem I had with this issue (#11591), there are two possible problems with this approach:
|
Chapter
|
Using API that returns failure after Protective programming would allow applications to misbehave without crashing, which leads to errors being ignored, because its "up and running" in the testing phase. So crashing is what I wan't. |
@0xc0170 Ping, this is reviewed and already passed the tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why reinterpret cast is needed but its all over the file for these handles
Description
Return value was ignored, and TDBStore:init() ended up in a
MBED_ERROR() phase after that.
TDBStore API was limited to allow returning of only two separate
errors, which may end up hiding the actual return value. Change
the documentation slightly to allow returning of original error
code from the underlying block device.
Fixes #11591
Pull request type
Reviewers
@VeijoPesonen
Release Notes
TDBSTore::init()
is now allowed to return error codes from underlying BlockeDevice.Previously the API was limited to return only
MBED_ERROR_READ_FAILED
orMBED_ERROR_WRITE_FAILED
which might have hidden the actual error code from the device.Now application will get the original return value passed from BlockDevice.