Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ErrorHandler] Display more information about the current exception #49613

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

Closed
lyrixx opened this issue Mar 6, 2023 · 0 comments · Fixed by #49620
Closed

[ErrorHandler] Display more information about the current exception #49613

lyrixx opened this issue Mar 6, 2023 · 0 comments · Fixed by #49620

Comments

@lyrixx
Copy link
Member

lyrixx commented Mar 6, 2023

Description

ATM, when an exception is thrown, we display only the message.
But, much more information can be embedded in the exception class.

It's possible to get theses informations via the profiler > logs > errors > context > expand.
It needs 3 click to be able to get them.

I think I would be much more convenient to display all theses information right away on the exception page.

Example

Before:

image

And with a click in the toolbar > context > expand

image

After:

  • ⚠️ I made a very quick and dirty POC to see if it's doable and easy
  • The "exception data" text is a toggle, off by default

image


so the question is: Should I open a PR to ship that in SF? (of course, with a better code and look and feel 😂)

@fabpot fabpot closed this as completed Mar 13, 2023
fabpot added a commit that referenced this issue Mar 13, 2023
… error page (lyrixx)

This PR was squashed before being merged into the 6.3 branch.

Discussion
----------

[ErrorHander] Display exception properties in the HTML error page

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #49613
| License       | MIT
| Doc PR        |

---

![image](https://user-images.githubusercontent.com/408368/223196868-77cd3215-7b40-4fab-8aa5-0327d39b5ef6.png)

---

<details>

<summary>Code to reproduce</summary>

```php

class MyException extends \Exception
{
    public function __construct()
    {
        parent ::__construct('some_message', 0, new MyException2());
    }

    public string $myMessage = 'some_message';
    public string $myCode = 'some_code';
    private string $privateStuff = 'private_stuff';
}

class MyException2 extends \Exception
{
    private string $anotherPrivateStuff = 'another_private_stuff';
}
```

</details>

Commits
-------

b041d06 [ErrorHander] Display exception properties in the HTML error page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants