Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestion from @xepozz
  • Loading branch information
xepozz authored Aug 9, 2025
commit 8cfee00a0c28172f643677452818c505270abc59
4 changes: 4 additions & 0 deletions src/Solution/SolutionProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

namespace Yiisoft\ErrorHandler\Solution;

/**
* The interface declares an adapter to render a solution for an event.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* The interface declares an adapter to render a solution for an event.
* Solution provider finds and renders a solution for a given throwable.

* Basically, it renders the error message as-is, but possible could render a button with click-to-fix action that will be handled by an HTTP request (with middleware) back to server.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* Basically, it renders the error message as-is, but possible could render a button with click-to-fix action that will be handled by an HTTP request (with middleware) back to server.
* It may render the message as-is, but it could also provide a button with a click-to-fix action that will be handled by an async HTTP request (using a separate middleware).

*/
interface SolutionProviderInterface
Comment thread
xepozz marked this conversation as resolved.
Comment thread
vjik marked this conversation as resolved.
Comment thread
xepozz marked this conversation as resolved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

SolutionProviderInterface must be placed into separate package. yiisoft/error-handler is too heavy dependency for packages, that implement SolutionProviderInterface.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's not about any solution in the air. It's about the specific contract between web, user, application and error.
It shouldn't be separated. At least for now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Interface should define format of solution. Users of interface should know about format of solution.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

HTML for sure

{
public function supports(\Throwable $e): bool;
Comment thread
xepozz marked this conversation as resolved.
Expand Down