Skip to content

Fix missing exception file and line info for debug rendering #92

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

klimov-paul
Copy link
Contributor

@klimov-paul klimov-paul commented May 3, 2023

Follow up #82

Fixes missing "file" and "line" info about exception on debug rendering.

Note: Exact file and line of thrown exception are not present in its trace, but stored separately.

Copy link
Owner

@yoanm yoanm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just features/json-rpc-specs/built-in-errors.feature:132 to update following the fix and CI should be green

@klimov-paul
Copy link
Contributor Author

LGTM, just features/json-rpc-specs/built-in-errors.feature:132 to update following the fix and CI should be green

That's problematic.
The failing test assets 2 arrays to be equal:
https://github.com/yoanm/php-jsonrpc-server-sdk/actions/runs/4873188197/jobs/8692398201?pr=92#step:8:812

In order to fix it, I should predict the exact name of the file, where exception is triggered:

'_file' => '/home/runner/work/php-jsonrpc...on.php'

If I hadrcode it, the test will function correctly only at the specific environment, and thus it will be unreilable.

Unfortunally Behat is betond my expertise, thus I can not say in wcich way it could be fixed properly.

@yoanm
Copy link
Owner

yoanm commented May 5, 2023

Arf, indeed 🤦
I'll take care of it this week-end.
I'll replace PHPUnit exact match with https://github.com/coduo/php-matcher, therefore it will be doable to use something like

"_file": "@[email protected]('MethodThatThrowExceptionDuringExecution.php')"

@yoanm
Copy link
Owner

yoanm commented May 6, 2023

PHP Coduo is available on master 🎉
I let you update the functional test with what I mentioned above.

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.

2 participants