Skip to content
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

ODataError::__toString() does not provide useful informations #309

Open
AntoineMarques opened this issue Aug 6, 2024 · 1 comment
Open
Labels
ToTriage type:enhancement Enhancement request targeting an existing experience

Comments

@AntoineMarques
Copy link

Describe the bug

When an error occurs, it is correctly parsed into a ODataError, which results in an Exception being thrown.
But when i try to get infos, for example by logging, no useful infos appear.
This is because ODataError infos are contained inside its error property which isn't printed.

Expected behavior

Overwrite __toString method in ODataError so that MainError obtained with getError is part of the serialization.
It contains error code, message and details

How to reproduce

try {
// Make some silly call to api to trigger an error

} catch (ODataError $e) {
var_dump($e->__toString()); // Only includes trace, no error code, message or details
}

SDK Version

No response

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
@AntoineMarques AntoineMarques added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Aug 6, 2024
@Ndiritu Ndiritu removed ToTriage status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Aug 8, 2024
@Ndiritu Ndiritu self-assigned this Aug 8, 2024
@Ndiritu Ndiritu added type:feature New experience request type:enhancement Enhancement request targeting an existing experience and removed ToTriage type:bug A broken experience type:feature New experience request labels Aug 8, 2024
@Ndiritu
Copy link
Contributor

Ndiritu commented Aug 9, 2024

Thanks for this suggestion @AntoineMarques. It definitely makes sense to make it easier to get the error code, message etc.

@Ndiritu Ndiritu removed their assignment Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ToTriage type:enhancement Enhancement request targeting an existing experience
Projects
None yet
Development

No branches or pull requests

2 participants