Skip to content

Communication's component validator does not propagate exceptions, obscuring the cause of the error #14555

Closed
@nikita2206

Description

@nikita2206

It was quite hard to understand the issue with my request schema until I went into Magento\Framework\Communication\Config\Validator and changed exception instantiation from new LogicException($message) to new LogicException($message, 0, $e). My issue was to do with this in the end: Each getter must have a doc block. It would be better if it was possible to see that error message out of the box, but instead I was only seeing Request schema definition for topic "..." should reference existing service class. Given ... (while the class obviously existed).

Preconditions

Magento 2.2.5

Steps to reproduce

  1. A schema class:
class Dummy {
    private $foo;

    public function getFoo() { return $this->foo; }
    public function setFoo($foo) { $this->foo = $foo; }
}
  1. Communication configuration (communication.xml):
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Communication/etc/communication.xsd">
    <topic name="foo_topic" request="Dummy" />
</config>
  1. Run validation for communication configuration. It can be done either automatically if you're using Magento EE, or can be done manually by calling into Magento\Framework\Communication\Config->getTopic("foo_topic")

Expected result

e

Actual result

r

Metadata

Metadata

Labels

Component: Framework/CommunicationEvent: squashtoberfestFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releasegood first issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions