Skip to content

How to get error message? #10626

@jeromecoutant

Description

@jeromecoutant

Description

When there is no "\n" in the error line, there is no message in the console:

Ex in some PSA file:
error("Could not write PSA storage version");

[1558446350.22][CONN][RXD] ++ MbedOS Error Info ++
[1558446350.27][CONN][RXD] Error Status: 0x80FF0100 Code: 256 Module: 255
[1558446350.31][CONN][RXD] Error Message: Fatal Run-time error
[1558446350.33][CONN][RXD] Location: 0x8022181
[1558446350.34][CONN][RXD] Error Value: 0x0
[1558446350.48][CONN][RXD] Current Thread: application_unnamed_thread  Id: 0x20001F00 Entry: 0x800A949 StackSize: 0x2000 StackMem: 0x200039E8 SP: 0x200057FC
[1558446350.57][CONN][RXD] For more info, visit: https://mbed.com/s/error?error=0x80FF0100&tgt=NUCLEO_L552ZE_Q
[1558446350.60][CONN][RXD] -- MbedOS Error Info --
[1558446450.13][HTST][INF] test suite run finished after 100.08 sec...

If I add \n:
error("Could not write PSA storage version\n");

We got:

[1558446853.92][CONN][RXD] ++ MbedOS Error Info ++
[1558446853.97][CONN][RXD] Error Status: 0x80FF0100 Code: 256 Module: 255
[1558446854.01][CONN][RXD] Error Message: Fatal Run-time error
[1558446854.03][CONN][RXD] Location: 0x8022181
[1558446854.04][CONN][RXD] Error Value: 0x0
[1558446854.18][CONN][RXD] Current Thread: application_unnamed_thread  Id: 0x20001F00 Entry: 0x800A949 StackSize: 0x2000 StackMem: 0x200039E8 SP: 0x200057FC
[1558446854.27][CONN][RXD] For more info, visit: https://mbed.com/s/error?error=0x80FF0100&tgt=NUCLEO_L552ZE_Q
[1558446854.30][CONN][RXD] -- MbedOS Error Info --
[1558446854.33][CONN][RXD] Could not write PSA storage version
[1558446953.85][HTST][INF] test suite run finished after 100.09 sec...

Solution 1: make patch in all file calling error without "\n"

Solution 2: add in mbed_error function a systematic end of line

Thx

Issue request type

[ ] Question
[x] Enhancement
[ ] Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions